diff --git a/#.gitignore# b/#.gitignore# new file mode 100644 index 000000000..814c15609 --- /dev/null +++ b/#.gitignore# @@ -0,0 +1,203 @@ +*~ +*.itf +*.po +*.qlf +*.xwam +*.wam +*.ma +*.s +*.o +*.so +*.dylib +*.dll +docs/yap.info* +.build +tags +TGSautom4te.cache +cscope.* +GPATH +m32 +GRTAGS +GTAGS +tmtags* +.autotools +.Rhistory +.zedstate +config.h +Yap.h +YapConfig.h +YapTermConfig.h +.graffiti +.#*# +*/#*# +*bak +*rej +*.db +groups +*.ede +.??* +*ggtags* +.atom-build.josn +.autotools +.cproject +.dir-locals.el +.DS_store +.kateproject +.project +.pydevproject +.Rhistory +.zedstate +.graffiti +.kateproject +autom4te.cache +*rej +#* +#*# +config.h +*.html +packages/gecode/dev +JIT/HPP/bkp +cmake_install.cmake +cmake_clean.cmake +*.build +C/myabsmi.c +*.ctags# +*.hs +CMakeFiles +*.make +C/new_iop.c +*.pdf +*.log +*.orig +JIT/HPP/#JIT_In# +*.text +yap +*startup.yss +*cmake_files +C/pl-yap.c +GitSHA1.c +.vscode +CMakeLists.txt.* +FindPackageLog.txt +GitSHA1.c +clang +cmake-build-debug +os/YapIOConfig.h +CodeBlocks + +os/readterm.c.cpp + +os/readterm.c.cpp + +packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot + +packages/ProbLog/#problog_lbdd.yap# + +packages/ProbLog/problog_examples/output/,_query_1_cluster_1.dot + +packages/ProbLog/problog_examples/output/out.dat + +packages/ProbLog/problog_examples/outputvalues.pl + +packages/ProbLog/problogbdd + +packages/raptor/raptor_config.h + +packages/real/rconfig.h + +packages/ProbLog/problog/#completion.yap# + +packages/ProbLog/problog_examples/output +packages/ProbLog/problog_examples/queries +packages/swig/java/*.java +packages/swig/java/*.class +packages/swig/java/*.jar +packages/swig/java/*wrap* +*jnilib +*.jar +*LOG +packages/cplint/approx/simplecuddLPADs/LPADBDD + +packages/swi-minisat2/˜:ilp +packages/swig/android/app +packages/cplint/L + +packages/CLPBN/horus/hcli +tmp +Eclipse +packages/bdd/simplecudd/problogbdd +trace +packages/bdd/cudd_config.h +Makefile +build +Debug +debug +Release +Build +xcode +Threads +droid +mxe +mxe32 +msys2 +caret +codelite +configure +Qt +cmake/cmake-android +sublime +yap-6.3.workspace +yap-6.3.geany +YAP.project +CBlocks +yPQ +*.tmp +YAP.sublime* +yap32 +Eclipse +codeblocks +yap-6.3.tags +android +yap.prj + +yap.VITORs-MBP.vsc.pui +vc +packages/myddas/pl/myddas_odbc.yap + +packages/myddas/pl/myddas_postgres.yap + +packages/myddas/pl/myddas_sqlite3.ypp + +packages/myddas/pl/#myddas_postgres.ypp# + +packages/myddas/hh + +packages/myddas/DaysInHospital_Y3.csv + +packages/myddas/agile.csv + +*.pyc + +*.cmake# + +*.tex + +*.c# + +packages/swig/yap_wrap.cxx + +packages/swig/yap_wrap.h + +packages/swig/yap_wrap.cpp + +packages/swig/yap.py + +*.ipynb +yap +packages/python/yap_kernel/x/__init__.py +x +packages/python/yap_kernel/x/__main__.py + +*.gch +mxe +build diff --git a/#GitSHA1.c.in# b/#GitSHA1.c.in# new file mode 100644 index 000000000..17c3143ef --- /dev/null +++ b/#GitSHA1.c.in# @@ -0,0 +1,2 @@ +eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee#define GIT_SHA1 "@GIT_SHA1@" +const char g_GIT_SHA1[] = GIT_SHA1; diff --git a/.configure-custom.sh b/.configure-custom.sh index 9c3f011d5..12243128a 100644 --- a/.configure-custom.sh +++ b/.configure-custom.sh @@ -1,2 +1,20 @@ -ENABLE_VARS="jit|no|WITH_JIT clpbn|yes|WITH_CLPBN cplint|yes|WITH_CPLINT horus|yes|WITH_HORUS docs|no|WITH_DOCS problog|yes|WITH_PROBLOG" -WITH_VARS="swig|yes|WITH_SWIG gecode|yes|WITH_GECODE R|yes|WITH_REAL cudd|yes|WITH_BDD python|yes|WITH_PYTHON " +ENABLE_VARS="clpbn|yes|WITH_CLPBN \ + cplint|yes|WITH_CPLINT \ + horus|yes|WITH_HORUS \ + clpr|yes|WITH_CLPR \ + problog|yes|WITH_PROBLOG \ + jit|no|WITH_JIT \ + chr|no|WITH_CHR \ + threads|no|WITH_THREADS" +WITH_VARS="swig|yes|WITH_SWIG \ + mpi|yes|WITH_MPI \ + gecode|yes|WITH_GECODE \ + docs|yes|WITH_DOCS \ + r|yes|WITH_REAL \ + cudd|yes|WITH_CUDD \ + xml2|yes|WITH_XML2 \ + raptor|yes|WITH_RAPTOR \ + python|yes|WITH_PYTHON \ + openssl|yes|WITH_OPENSSL\ + readline|yes|WITH_READLINE \ + gmp|yes|WITH_GMP " diff --git a/.ctags b/.ctags index 2fc149c54..2f53b2a9a 100644 --- a/.ctags +++ b/.ctags @@ -6,6 +6,7 @@ --regex-Prolog=/^([a-z][A-Za-z0-9_]*:)?\'(.*)\'\(.*\)\.[ \t]*.*/\2/p,predicate,predicate definition/ --regex-Prolog=/^:-[ \t]+(discontiguous|dynamic|multifile|table|thread_local)[ \t]+([a-z][_a-zA-Z0-9]*:)?([a-z0-9_][_a-zA-Z0-9]*)/\1/p,predicate,predicate metadata/ --regex-Prolog=/^[ \t]*Yap_InitCPred[ \t]*\"(\$?[A-Za-z0-9_]*)\"([ \t]*).*/\1/p,predicate,predicate definition/ +--langmap=C:+.(h.cmake).(h.config) --exclude=\._* --exclude=*\.bak --exclude=\.svn @@ -22,3 +23,8 @@ --exclude=\#.* --exclude=(.)\#* --exclude=*.dylib +--exclude=docs +--exclude=build +--exclude=cmake-build-debug +--exclude=clang + diff --git a/.gitignore b/.gitignore index e9a3c5a7c..42f6b30ff 100644 --- a/.gitignore +++ b/.gitignore @@ -80,15 +80,11 @@ GitSHA1.c CMakeLists.txt.* FindPackageLog.txt GitSHA1.c - -GitSHA1.c - +clang +cmake-build-debug os/YapIOConfig.h - -os/YapIOConfig.h - -os/YapIOConfig.h - +CodeBlocks +x os/readterm.c.cpp os/readterm.c.cpp @@ -203,3 +199,5 @@ packages/python/yap_kernel/x/__init__.py packages/python/yap_kernel/x/__main__.py *.gch +mxe +build diff --git a/BEAM/eamamasm.c b/BEAM/eamamasm.c index 9773e091e..3671a3d19 100644 --- a/BEAM/eamamasm.c +++ b/BEAM/eamamasm.c @@ -12,8 +12,8 @@ #ifdef BEAM #include "Yap.h" -#include "compile.h" -#include "clause.h" +#include "YapCompile.h" +#include "clause.h" #include "eam.h" #include "eamamasm.h" #include @@ -85,7 +85,7 @@ int X_Var(Ventry *ve) int var; if (ve->KindOfVE == PermVar || ve->KindOfVE == VoidVar ) { - printf("Erro no tipo de variavel X ->eamamas.c \n"); + printf("Erro no tipo de variavel X ->eamamas.c \n"); exit(1); } var = ((ve->NoOfVE) & MaskVarAdrs); @@ -99,7 +99,7 @@ int Y_Var(Ventry *ve) { int var; if (ve->KindOfVE != PermVar) { - printf("Erro no tipo de variavel Y ->eamamas.c \n"); + printf("Erro no tipo de variavel Y ->eamamas.c \n"); exit(1); } var = ((ve->NoOfVE) & MaskVarAdrs); @@ -119,7 +119,7 @@ void eam_pass(CInstr *ppc) { int alloc_found=0; int body=0; - + while (ppc) { switch ((int) ppc->op) { @@ -184,7 +184,7 @@ void eam_pass(CInstr *ppc) } else { emit_inst(_unify_val_Y_op); emit_par(Y_Var((Ventry *) ppc->new4)); - + } } else { emit_inst(_unify_void_op); } break; @@ -268,7 +268,7 @@ void eam_pass(CInstr *ppc) case put_atom_op: emit_inst(_put_atom_op); emit_par(ppc->new1); - emit_par(ppc->new4); + emit_par(ppc->new4); break; case put_list_op: emit_inst(_put_list_op); @@ -349,7 +349,7 @@ void eam_pass(CInstr *ppc) case cut_op: emit_inst(_cut_op); - break; + break; case commit_op: emit_inst(_commit_op); break; @@ -402,7 +402,7 @@ void eam_pass(CInstr *ppc) } emit_par(ppc->new4); break; - + case direct_safe_call_op: if (ppc->new1==1) { emit_inst(_direct_safe_call_unary_op); @@ -434,8 +434,8 @@ void eam_pass(CInstr *ppc) if (a==NULL) a=Yap_LookupAtom("\n"); emit_inst(_put_atom_op); emit_par(1); - emit_par((Cell) MkAtomTerm(a)); - } + emit_par((Cell) MkAtomTerm(a)); + } emit_inst(_write_call); break; case is_op: @@ -468,50 +468,50 @@ void eam_pass(CInstr *ppc) case remove_box_op: case remove_last_box_op: break; - + case jump_op: emit_inst(_jump_op); emit_upar((Cell) Code_Start+ (Cell) labels[ppc->new4]); break; case label_op: - if (pass==0) labels[ppc->new4] = get_addr(); + if (pass==0) labels[ppc->new4] = get_addr(); break; case run_op: /* se ficar vazio, retirar no eam_am.c o +5 das linhas pc=clause->code+5 no only_1_clause e no call */ emit_inst(_try_me_op); emit_par(0); - emit_par(0); emit_par(0); - emit_par(0); + emit_par(0); + emit_par(0); break; case only_1_clause_op: emit_inst(_only_1_clause_op); emit_par(ppc->new4); emit_par(((struct Clauses *)ppc->new4)->predi->arity); - emit_par(((struct Clauses *)ppc->new4)->nr_vars); + emit_par(((struct Clauses *)ppc->new4)->nr_vars); emit_par(0); /* Nr da alternativa */ break; case try_me_op: emit_inst(_try_me_op); - emit_par(ppc->new4); + emit_par(ppc->new4); emit_par(((struct Clauses *)ppc->new4)->predi->arity); - emit_par(((struct Clauses *)ppc->new4)->nr_vars); + emit_par(((struct Clauses *)ppc->new4)->nr_vars); emit_par(0); /* Nr da alternativa */ break; case retry_me_op: emit_inst(_retry_me_op); emit_par(ppc->new4); emit_par(((struct Clauses *)ppc->new4)->predi->arity); - emit_par(((struct Clauses *)ppc->new4)->nr_vars); + emit_par(((struct Clauses *)ppc->new4)->nr_vars); emit_par(ppc->new1); break; case trust_me_op: emit_inst(_trust_me_op); emit_par(ppc->new4); emit_par(((struct Clauses *)ppc->new4)->predi->arity); - emit_par(((struct Clauses *)ppc->new4)->nr_vars); + emit_par(((struct Clauses *)ppc->new4)->nr_vars); emit_par(ppc->new1); break; @@ -529,11 +529,11 @@ void eam_pass(CInstr *ppc) } body=1; break; - + case prepare_tries: emit_inst(_prepare_tries); - emit_par(ppc->new1); - emit_par(ppc->new4); + emit_par(ppc->new1); + emit_par(ppc->new4); break; case exit_op: @@ -559,7 +559,7 @@ void eam_pass(CInstr *ppc) printf("[ please note that beam still does not support a lot of builtins ]\n"); } emit_inst(_fail_op); - + } ppc = ppc->nextInst; } diff --git a/BEAM/eamindex.c b/BEAM/eamindex.c index 59d6ce964..f9aa20db8 100644 --- a/BEAM/eamindex.c +++ b/BEAM/eamindex.c @@ -12,8 +12,8 @@ #ifdef BEAM #include "Yap.h" -#include "compile.h" -#include "clause.h" +#include "YapCompile.h" +#include "clause.h" #include "eam.h" #include #include @@ -40,13 +40,13 @@ int exists_on_table(Cell a,struct HASH_TABLE **table, int i) struct HASH_TABLE *t; t=table[i]; - + while(t) { if (t->value==a) return(1); - + t=t->next; } - + return(0); } @@ -61,20 +61,20 @@ Cell *gera_codigo_try(struct Predicates *predi) /* gerar os try's para o predic emit_new(prepare_tries,predi->nr_alt,predi->arity); if (predi->nr_alt==1) { - emit_new(only_1_clause_op,0,(unsigned long) c); - } else if (predi->nr_alt>1) { + emit_new(only_1_clause_op,0,(unsigned long) c); + } else if (predi->nr_alt>1) { while(c!=NULL) { - if (nr+1==predi->nr_alt) emit_new(trust_me_op,nr,(unsigned long) c); + if (nr+1==predi->nr_alt) emit_new(trust_me_op,nr,(unsigned long) c); else if (nr==0) emit_new(try_me_op,predi->nr_alt,(unsigned long) c); else emit_new(retry_me_op,nr,(unsigned long) c); c=c->next; nr++; } - } else { + } else { emit_new(fail_op,0,0); } - + return(eam_assemble(StartCode)); } @@ -91,7 +91,7 @@ Cell *gera_codigo_try_list(struct Predicates *predi) /* gerar os try's para o p c=predi->first; emit_new(prepare_tries,nr_preds,predi->arity); - if (nr_preds>=1) { + if (nr_preds>=1) { while(c!=NULL) { if (c->predi==predi && (c->idx==Lista || c->idx==Variavel)) { if (nr_preds==1) { @@ -108,20 +108,20 @@ Cell *gera_codigo_try_list(struct Predicates *predi) /* gerar os try's para o p } else { emit_new(fail_op,0,0); } - + return(eam_assemble(StartCode)); } -struct HASH_TABLE **gera_codigo_try_atom(struct Predicates *predi) +struct HASH_TABLE **gera_codigo_try_atom(struct Predicates *predi) { int j,nr_preds,nr_atoms; struct HASH_TABLE **table; struct HASH_TABLE *t; struct Clauses *cla; - nr_atoms=predi->idx_atom; + nr_atoms=predi->idx_atom; nr_preds=nr_atoms+predi->idx_var; table=malloc(sizeof(struct HASH_TABLE *)*(nr_atoms+1)); for (j=0;j<=nr_atoms;j++) table[j]=NULL; @@ -132,7 +132,7 @@ struct Clauses *cla; Cell a; unsigned int index; int nr; - + a=cla->val; if (a && nr_atoms) { index=index_of_hash_table_atom(a,nr_atoms); @@ -187,18 +187,18 @@ struct HASH_TABLE **table; struct HASH_TABLE *t; struct Clauses *cla; - nr_appls=predi->idx_functor; + nr_appls=predi->idx_functor; nr_preds=nr_appls+predi->idx_var; table=malloc(sizeof(struct HASH_TABLE *)*(nr_appls+1)); for (j=0;j<=nr_appls;j++) table[j]=NULL; - + cla=predi->first; while(cla) { if (cla->idx==Estrutura) { Cell a; long int index; int nr; - + a=cla->val; if (a && nr_appls) { index=index_of_hash_table_appl(a,nr_appls); @@ -257,7 +257,7 @@ Cell *gera_codigo_try_only_vars(struct Predicates *predi) /* gerar os try's de V c=predi->first; emit_new(prepare_tries,nr_preds,predi->arity); - if (nr_preds>=1) { + if (nr_preds>=1) { while(c!=NULL) { if (c->predi==predi && c->idx==Variavel) { if (nr_preds==1) { @@ -274,7 +274,7 @@ Cell *gera_codigo_try_only_vars(struct Predicates *predi) /* gerar os try's de V } else { emit_new(fail_op,0,0); } - + return(eam_assemble(StartCode)); } @@ -292,7 +292,7 @@ void do_eam_indexing(struct Predicates *p) p->idx=1; } - if((Print_Code & 4) && (Print_Code & 8)) { + if((Print_Code & 4) && (Print_Code & 8)) { printf("General Case :\n"); eam_showcode(p->code); } @@ -309,10 +309,10 @@ void ver_predicados(struct Predicates *p) c=p->first; while(c!=NULL) { - printf("Clausula %d do tipo %d (%d locals %d args) (val=0x%X)\n",++i,c->idx,c->nr_vars,c->predi->arity, (unsigned )c->val); + printf("Clausula %d do tipo %d (%d locals %d args) (val=0x%X)\n",++i,c->idx,c->nr_vars,c->predi->arity, (unsigned )c->val); c=c->next; } - + } diff --git a/C/alloc.c b/C/alloc.c index 395d9ab5f..8614ebbe6 100644 --- a/C/alloc.c +++ b/C/alloc.c @@ -1,4 +1,4 @@ - /************************************************************************* +/************************************************************************* * * * YAP Prolog * * * @@ -78,7 +78,7 @@ void *my_malloc(size_t sz) { p = malloc(sz); // Yap_DebugPuts(stderr,"gof\n"); if (Yap_do_low_level_trace) - fprintf(stderr, "+ %p : %lu\n", p, sz); + fprintf(stderr, "+ %p: %" Sizet_F "\n", p, sz); if (sz > 500 && write_malloc++ > 0) __android_log_print(ANDROID_LOG_ERROR, "YAPDroid ", "+ %d %p", write_malloc, p); @@ -90,7 +90,7 @@ void *my_realloc(void *ptr, size_t sz) { p = realloc(ptr, sz); if (Yap_do_low_level_trace) - // fprintf(stderr, "+ %p -> %p : %lu\n", ptr, p, sz); + // fprintf(stderr, "+ %p -> %p : " Sizet_F "\n", ptr, p, sz); // Yap_DebugPuts(stderr,"gof\n"); if (sz > 500 && write_malloc++ > 0) __android_log_print(ANDROID_LOG_ERROR, "YAPDroid ", "* %d %p", write_malloc, diff --git a/C/amasm.c b/C/amasm.c index de132f952..ca67e65af 100755 --- a/C/amasm.c +++ b/C/amasm.c @@ -188,7 +188,7 @@ static char SccsId[] = "@(#)amasm.c 1.3 3/15/90"; #include "Yap.h" #include "clause.h" -#include "compile.h" +#include "YapCompile.h" #include "yapio.h" #ifdef BEAM diff --git a/C/arith0.c b/C/arith0.c index fce74e9d3..7d8a023aa 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -111,7 +111,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" diff --git a/C/arith1.c b/C/arith1.c index 8514804dd..abaab04cc 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -20,9 +20,9 @@ static char SccsId[] = "%W% %G%"; /** @file arith1.c - + @addtogroup arithmetic_operators - + - exp( _X_) [ISO]

@anchor exp_1 Natural exponential. @@ -109,7 +109,7 @@ static char SccsId[] = "%W% %G%"; - integer( _X_)

@anchor integer_1_op - If _X_ evaluates to a float, the integer between the value of _X_ and 0 closest to the value of _X_, else if _X_ evaluates to an + If _X_ evaluates to a float, the integer between the value of _X_ and 0 closest to the value of _X_, else if _X_ evaluates to an integer, the value of _X_. - float( _X_) [ISO]

@anchor float_1_op @@ -178,7 +178,7 @@ A = 3602879701896397 rdiv 36028797018963968 Convert the expression _X_ to a rational number or integer. The function is similar to [rational/1](@ref rational_1), but the result is only accurate within the rounding error of floating point numbers, generally producing a much - smaller denominator. + smaller denominator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~prolog ?- A is rationalize(0.25). @@ -228,7 +228,7 @@ X is Y*10+C-48. #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Term float_to_int(Float v USES_REGS) @@ -298,24 +298,24 @@ get_float(Term t) { #else static double my_rint(double x) -{ - double y, z; - Int n; - - if (x >= 0) { - y = x + 0.5; - z = floor(y); - n = (Int) z; +{ + double y, z; + Int n; + + if (x >= 0) { + y = x + 0.5; + z = floor(y); + n = (Int) z; if (y == z && n % 2) - return(z-1); - } else { - y = x - 0.5; - z = ceil(y); - n = (Int) z; + return(z-1); + } else { + y = x - 0.5; + z = ceil(y); + n = (Int) z; if (y == z && n % 2) - return(z+1); + return(z+1); } - return(z); + return(z); } #endif @@ -412,7 +412,7 @@ eval1(Int fi, Term t USES_REGS) { { #ifdef USE_GMP Int i = IntegerOfTerm(t); - + if (i == Int_MIN) { return Yap_gmp_neg_int(i); } @@ -745,7 +745,7 @@ eval1(Int fi, Term t USES_REGS) { if (dbl < 0.0) RBIG_FL(ceil(dbl)); else - RBIG_FL(floor(dbl)); + RBIG_FL(floor(dbl)); } case op_float: switch (ETypeOfTerm(t)) { @@ -967,7 +967,7 @@ Yap_NameOfUnaryOp(int i) return Yap_LookupAtom(InitUnTab[i].OpName); } -static Int +static Int p_unary_is( USES_REGS1 ) { /* X is Y */ Term t = Deref(ARG2); @@ -1017,7 +1017,7 @@ p_unary_is( USES_REGS1 ) return(FALSE); } -static Int +static Int p_unary_op_as_integer( USES_REGS1 ) { /* X is Y */ Term t = Deref(ARG1); @@ -1075,4 +1075,3 @@ Yap_ReInitUnaryExps(void) { return TRUE; } - diff --git a/C/arith2.c b/C/arith2.c index ddce481a5..5a26fced4 100644 --- a/C/arith2.c +++ b/C/arith2.c @@ -127,7 +127,7 @@ These are the binary numeric operators currently supported by YAP. #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #include "arith2.h" diff --git a/C/arrays.c b/C/arrays.c index f621bd075..eb219ad3c 100644 --- a/C/arrays.c +++ b/C/arrays.c @@ -102,7 +102,7 @@ The following predicates manipulate arrays: #include "Yap.h" #include "Yatom.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #include "heapgc.h" #if HAVE_ERRNO_H #include diff --git a/C/atomic.c b/C/atomic.c old mode 100644 new mode 100755 index 30e7221aa..a7447c58d --- a/C/atomic.c +++ b/C/atomic.c @@ -36,10 +36,10 @@ The following predicates are used to manipulate atoms: */ #include "Yap.h" +#include "YapEval.h" #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" #include "yapio.h" #ifdef TABLING #include "tab.macros.h" @@ -68,22 +68,6 @@ static Int hide_atom(USES_REGS1); static Int hidden_atom(USES_REGS1); static Int unhide_atom(USES_REGS1); -#define ReleaseAndReturn(r) \ - { \ - pop_text_stack(l); \ - return r; \ - } -#define release_cut_fail() \ - { \ - pop_text_stack(l); \ - cut_fail(); \ - } -#define release_cut_succeed() \ - { \ - pop_text_stack(l); \ - cut_succeed(); \ - } - static int AlreadyHidden(unsigned char *name) { AtomEntry *chain; @@ -1715,22 +1699,24 @@ static Int atom_split(USES_REGS1) { ReleaseAndReturn((FALSE)); } at = AtomOfTerm(t1); - unsigned char *s, *s1, *s10; - s = RepAtom(at)->UStrOfAE; - if (len > (Int)strlen_utf8(s)) + char *s; + unsigned char *s1, *s10, *s0; + s = RepAtom(at)->StrOfAE; + if (len > strlen(s)) ReleaseAndReturn((FALSE)); s1 = s10 = Malloc(len); + s0 = RepAtom(at)->UStrOfAE; if (s1 + len > (unsigned char *)ASP - 1024) Yap_Error(RESOURCE_ERROR_STACK, t1, "$atom_split/4"); size_t j; for (j = 0; j < len; j++) { int32_t val; - s += get_utf8(s, 1, &val); - s1 += put_utf8(s, val); + s0 += get_utf8(s0, 1, &val); + s1 += put_utf8(s1, val); } s1[0] = '\0'; to1 = MkAtomTerm(Yap_ULookupAtom(s10)); - to2 = MkAtomTerm(Yap_ULookupAtom(s)); + to2 = MkAtomTerm(Yap_LookupAtom(s)); ReleaseAndReturn( (Yap_unify_constant(ARG3, to1) && Yap_unify_constant(ARG4, to2))); } @@ -1790,8 +1776,8 @@ restart_aux: #define SUB_ATOM_HAS_ATOM 16 #define SUB_ATOM_HAS_UTF8 32 -static Term build_new_atomic(int mask, wchar_t *wp, const unsigned char *p, - size_t minv, size_t len USES_REGS) { +static Term build_new_atomic(int mask, const unsigned char *p, size_t minv, + size_t len USES_REGS) { int n; seq_tv_t outv[5], inp; size_t cuts[3]; @@ -1872,651 +1858,577 @@ static int check_sub_atom_bef(int max, Atom at, Atom nat) { } static Int cont_sub_atomic(USES_REGS1) { - Term tat1 = Deref(ARG1); - Term tat5 = Deref(ARG5); - int mask; - size_t minv, len, after, sz; - wchar_t *wp = NULL; - const unsigned char *p = NULL, *p5 = NULL; + Term tat1 = Deref(ARG1); + Term tat5 = Deref(ARG5); + int mask; + size_t minv, len, after, sz; + const unsigned char *p = NULL, *p5 = NULL; - mask = IntegerOfTerm(EXTRA_CBACK_ARG(5, 1)); - minv = IntegerOfTerm(EXTRA_CBACK_ARG(5, 2)); - len = IntegerOfTerm(EXTRA_CBACK_ARG(5, 3)); - after = IntegerOfTerm(EXTRA_CBACK_ARG(5, 4)); - sz = IntegerOfTerm(EXTRA_CBACK_ARG(5, 5)); + mask = IntegerOfTerm(EXTRA_CBACK_ARG(5, 1)); + minv = IntegerOfTerm(EXTRA_CBACK_ARG(5, 2)); + len = IntegerOfTerm(EXTRA_CBACK_ARG(5, 3)); + after = IntegerOfTerm(EXTRA_CBACK_ARG(5, 4)); + sz = IntegerOfTerm(EXTRA_CBACK_ARG(5, 5)); - if (!IsVarTerm(tat1)) { - if (IsAtomTerm(tat1)) { - p = AtomOfTerm(tat1)->UStrOfAE; - } else { - p = UStringOfTerm(tat1); - } - } - if (!IsVarTerm(tat5)) { - if (IsAtomTerm(tat5)) { - p5 = AtomOfTerm(tat5)->UStrOfAE; - } else { - p5 = UStringOfTerm(tat5); - } - } - /* we can have one of two cases: A5 bound or unbound */ - if (mask & SUB_ATOM_HAS_VAL) { - bool found = false; - { - const unsigned char *p1 = p; - - while (!found) { - p = skip_utf8(p1, minv); - if (cmpn_utf8(p, p5, len) == 0) { - Yap_unify(ARG2, MkIntegerTerm(minv)); - Yap_unify(ARG3, MkIntegerTerm(len)); - Yap_unify(ARG4, MkIntegerTerm(after)); - found = true; - /* found one, check if there is any left */ - while (minv <= sz - len) { - int chr; - p += get_utf8((unsigned char *)p, -1, &chr); - after--; - minv++; - if (cmpn_utf8(p, p5, len) == 0) - break; - } - } else { - if (minv == sz - len) - break; - after--; - minv++; - } - } - } - if (found) { - if (minv > sz - len) - cut_succeed(); - } else { - cut_fail(); - } - } else if (mask & SUB_ATOM_HAS_SIZE) { - Term nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - Yap_unify(ARG2, MkIntegerTerm(minv)); - Yap_unify(ARG4, MkIntegerTerm(after)); - Yap_unify(ARG5, nat); - minv++; - if (after-- == 0) - cut_succeed(); - } else if (mask & SUB_ATOM_HAS_MIN) { - after = sz - (minv + len); - Term nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - Yap_unify(ARG3, MkIntegerTerm(len)); - Yap_unify(ARG4, MkIntegerTerm(after)); - Yap_unify(ARG5, nat); - len++; - if (after-- == 0) - cut_succeed(); - } else if (mask & SUB_ATOM_HAS_AFTER) { - len = sz - (minv + after); - Term nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - Yap_unify(ARG2, MkIntegerTerm(minv)); - Yap_unify(ARG3, MkIntegerTerm(len)); - Yap_unify(ARG5, nat); - minv++; - if (len-- == 0) - cut_succeed(); + if (!IsVarTerm(tat1)) { + if (IsAtomTerm(tat1)) { + p = AtomOfTerm(tat1)->UStrOfAE; } else { - Term nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - Yap_unify(ARG2, MkIntegerTerm(minv)); - Yap_unify(ARG3, MkIntegerTerm(len)); - Yap_unify(ARG4, MkIntegerTerm(after)); - Yap_unify(ARG5, nat); - len++; - if (after-- == 0) { - if (minv == sz) - cut_succeed(); - minv++; - len = 0; - after = sz - minv; - } + p = UStringOfTerm(tat1); } - EXTRA_CBACK_ARG(5, 1) = MkIntegerTerm(mask); - EXTRA_CBACK_ARG(5, 2) = MkIntegerTerm(minv); - EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(len); - EXTRA_CBACK_ARG(5, 4) = MkIntegerTerm(after); - EXTRA_CBACK_ARG(5, 5) = MkIntegerTerm(sz); - return TRUE; + } + if (!IsVarTerm(tat5)) { + if (IsAtomTerm(tat5)) { + p5 = AtomOfTerm(tat5)->UStrOfAE; + } else { + p5 = UStringOfTerm(tat5); + } + } + /* we can have one of two cases: A5 bound or unbound */ + if (mask & SUB_ATOM_HAS_VAL) { + bool found = false; + { + const unsigned char *p1 = p; + + while (!found) { + p = skip_utf8(p1, minv); + if (cmpn_utf8(p, p5, len) == 0) { + Yap_unify(ARG2, MkIntegerTerm(minv)); + Yap_unify(ARG3, MkIntegerTerm(len)); + Yap_unify(ARG4, MkIntegerTerm(after)); + found = true; + /* found one, check if there is any left */ + while (minv <= sz - len) { + int chr; + p += get_utf8((unsigned char *)p, -1, &chr); + after--; + minv++; + if (cmpn_utf8(p, p5, len) == 0) + break; + } + } else { + if (minv == sz - len) + break; + after--; + minv++; + } + } + } + if (found) { + if (minv > sz - len) + cut_succeed(); + } else { + cut_fail(); + } + } else if (mask & SUB_ATOM_HAS_SIZE) { + Term nat = build_new_atomic(mask, p, minv, len PASS_REGS); + Yap_unify(ARG2, MkIntegerTerm(minv)); + Yap_unify(ARG4, MkIntegerTerm(after)); + Yap_unify(ARG5, nat); + minv++; + if (after-- == 0) + cut_succeed(); + } else if (mask & SUB_ATOM_HAS_MIN) { + after = sz - (minv + len); + Term nat = build_new_atomic(mask, p, minv, len PASS_REGS); + Yap_unify(ARG3, MkIntegerTerm(len)); + Yap_unify(ARG4, MkIntegerTerm(after)); + Yap_unify(ARG5, nat); + len++; + if (after-- == 0) + cut_succeed(); + } else if (mask & SUB_ATOM_HAS_AFTER) { + len = sz - (minv + after); + Term nat = build_new_atomic(mask, p, minv, len PASS_REGS); + Yap_unify(ARG2, MkIntegerTerm(minv)); + Yap_unify(ARG3, MkIntegerTerm(len)); + Yap_unify(ARG5, nat); + minv++; + if (len-- == 0) + cut_succeed(); + } else { + Term nat = build_new_atomic(mask, p, minv, len PASS_REGS); + Yap_unify(ARG2, MkIntegerTerm(minv)); + Yap_unify(ARG3, MkIntegerTerm(len)); + Yap_unify(ARG4, MkIntegerTerm(after)); + Yap_unify(ARG5, nat); + len++; + if (after-- == 0) { + if (minv == sz) + cut_succeed(); + minv++; + len = 0; + after = sz - minv; + } + } + EXTRA_CBACK_ARG(5, 1) = MkIntegerTerm(mask); + EXTRA_CBACK_ARG(5, 2) = MkIntegerTerm(minv); + EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(len); + EXTRA_CBACK_ARG(5, 4) = MkIntegerTerm(after); + EXTRA_CBACK_ARG(5, 5) = MkIntegerTerm(sz); + return TRUE; } +static Int sub_atomic(bool sub_atom, bool sub_string USES_REGS) { + Term tat1, tbef, tsize, tafter, tout; + int mask = SUB_ATOM_HAS_UTF8; + size_t minv, len, after, sz; + const unsigned char *p = NULL; + int bnds = 0; + Term nat = 0L; + Atom at = NULL; - static Int sub_atomic(bool sub_atom, bool sub_string USES_REGS) { - Term tat1, tbef, tsize, tafter, tout; - int mask = SUB_ATOM_HAS_UTF8; - size_t minv, len, after, sz; - wchar_t *wp = NULL; - const unsigned char *p = NULL; - int bnds = 0; - Term nat = 0L; - Atom at = NULL; + int l = push_text_stack(); + if (sub_atom) + mask |= SUB_ATOM_HAS_ATOM; - int l = push_text_stack(); - if (sub_atom) - mask |= SUB_ATOM_HAS_ATOM; + tat1 = Deref(ARG1); - tat1 = Deref(ARG1); - - if (!IsVarTerm(tat1)) { - if (sub_atom) { - if (IsAtomTerm(tat1)) { - p = AtomOfTerm(tat1)->UStrOfAE; - sz = strlen_utf8(p); - } else { - Yap_Error(TYPE_ERROR_ATOM, tat1, "sub_atom/5"); - ReleaseAndReturn(false); - } - } else if (sub_string) { - if (IsStringTerm(tat1)) { - p = UStringOfTerm(tat1); - sz = strlen_utf8(p); - } else { - Yap_Error(TYPE_ERROR_STRING, tat1, "sub_atom/5"); - ReleaseAndReturn(false); - } - } + if (!IsVarTerm(tat1)) { + if (sub_atom) { + if (IsAtomTerm(tat1)) { + p = AtomOfTerm(tat1)->UStrOfAE; + sz = strlen_utf8(p); } else { - Yap_Error(INSTANTIATION_ERROR, tat1, "sub_atom/5: first variable\n"); + Yap_Error(TYPE_ERROR_ATOM, tat1, "sub_atom/5"); ReleaseAndReturn(false); } - EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(0); - tbef = Deref(ARG2); - if (IsVarTerm(tbef)) { - minv = 0; - } else if (!IsIntegerTerm(tbef)) { - Yap_Error(TYPE_ERROR_INTEGER, tbef, "sub_string/5"); - ReleaseAndReturn(FALSE); + } else if (sub_string) { + if (IsStringTerm(tat1)) { + p = UStringOfTerm(tat1); + sz = strlen_utf8(p); } else { - minv = IntegerOfTerm(tbef); - if ((Int)minv < 0) { - Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tbef, "sub_string/5"); - ReleaseAndReturn(FALSE); - }; - mask |= SUB_ATOM_HAS_MIN; - bnds++; + Yap_Error(TYPE_ERROR_STRING, tat1, "sub_string/5"); + ReleaseAndReturn(false); } - if (IsVarTerm(tsize = Deref(ARG3))) { - len = 0; - } else if (!IsIntegerTerm(tsize)) { - Yap_Error(TYPE_ERROR_INTEGER, tsize, "sub_string/5"); - ReleaseAndReturn(FALSE); + } else { + if ((p = Yap_TextToUTF8Buffer(tat1 PASS_REGS))) { + sz = strlen_utf8(p); } else { - len = IntegerOfTerm(tsize); - if ((Int)len < 0) { - Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tsize, "sub_string/5"); - ReleaseAndReturn(FALSE); - }; - mask |= SUB_ATOM_HAS_SIZE; - bnds++; + ReleaseAndReturn(false) } - if (IsVarTerm(tafter = Deref(ARG4))) { - after = 0; - } else if (!IsIntegerTerm(tafter)) { - Yap_Error(TYPE_ERROR_INTEGER, tafter, "sub_string/5"); - ReleaseAndReturn(FALSE); - } else { - after = IntegerOfTerm(tafter); - if ((Int)after < 0) { - Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tafter, "sub_string/5"); - ReleaseAndReturn(FALSE); - }; - mask |= SUB_ATOM_HAS_AFTER; - bnds++; - } - if (!IsVarTerm(tout = Deref(ARG5))) { - if (sub_atom) { - if (!IsAtomTerm(tout)) { - Yap_Error(TYPE_ERROR_ATOM, tout, "sub_atom/5"); - ReleaseAndReturn(FALSE); - } else { - Atom oat; - mask |= SUB_ATOM_HAS_VAL | SUB_ATOM_HAS_SIZE; - oat = AtomOfTerm(tout); - len = strlen_utf8(RepAtom(oat)->UStrOfAE); - } - } else { - if (!IsStringTerm(tout)) { - Yap_Error(TYPE_ERROR_STRING, tout, "sub_string/5"); - ReleaseAndReturn(FALSE); - } else { - mask |= SUB_ATOM_HAS_VAL | SUB_ATOM_HAS_SIZE; - len = strlen_utf8(UStringOfTerm(tout)); - } - } - if (!Yap_unify(ARG3, MkIntegerTerm(len))) - release_cut_fail(); - bnds += 2; - } - /* the problem is deterministic if we have two cases */ - if (bnds > 1) { - int out = FALSE; + } + } else { - if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_SIZE)) == - (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_SIZE)) { - if (minv + len > sz) - release_cut_fail(); - if ((Int)(after = (sz - (minv + len))) < 0) - release_cut_fail(); - nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - if (!nat) - release_cut_fail(); - out = Yap_unify(ARG4, MkIntegerTerm(after)) && Yap_unify(ARG5, nat); - } else if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_AFTER)) == - (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_AFTER)) { - if (sz < minv + after) - release_cut_fail(); - len = sz - (minv + after); - nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - if (!nat) - release_cut_fail(); - out = Yap_unify(ARG3, MkIntegerTerm(len)) && Yap_unify(ARG5, nat); - } else if ((mask & (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_AFTER)) == - (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_AFTER)) { - if (len + after > sz) - release_cut_fail(); - minv = sz - (len + after); - nat = build_new_atomic(mask, wp, p, minv, len PASS_REGS); - if (!nat) - release_cut_fail(); - out = Yap_unify(ARG2, MkIntegerTerm(minv)) && Yap_unify(ARG5, nat); - } else if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_VAL)) == - (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_VAL)) { - if (sub_atom) - out = check_sub_atom_at(minv, at, AtomOfTerm(nat), len); - else - out = check_sub_string_at(minv, p, UStringOfTerm(nat), len); - } else if ((mask & (SUB_ATOM_HAS_AFTER | SUB_ATOM_HAS_VAL)) == - (SUB_ATOM_HAS_AFTER | SUB_ATOM_HAS_VAL)) { - if (sub_atom) - out = check_sub_atom_bef(sz - after, at, AtomOfTerm(nat)); - else - out = check_sub_string_bef(sz - after, tat1, tout); - } else if ((mask & (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_VAL)) == - (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_VAL)) { - if (!sub_atom) { - out = (strlen_utf8(UStringOfTerm(tout)) == len); - if (!out) - release_cut_fail(); - } else { - out = (strlen_utf8(RepAtom(AtomOfTerm(tout))->UStrOfAE) == len); - if (!out) - release_cut_fail(); - } - if (len == sz) { - out = out && Yap_unify(ARG1, ARG5) && - Yap_unify(ARG2, MkIntegerTerm(0)) && - Yap_unify(ARG4, MkIntegerTerm(0)); - } else if (len > sz) { - release_cut_fail(); - } else { - mask |= SUB_ATOM_HAS_SIZE; - minv = 0; - after = sz - len; - goto backtrackable; - } - } - if (out) - release_cut_succeed(); + Yap_Error(INSTANTIATION_ERROR, tat1, "sub_atom/5: first variable\n"); + ReleaseAndReturn(false); + } + EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(0); + tbef = Deref(ARG2); + if (IsVarTerm(tbef)) { + minv = 0; + } else if (!IsIntegerTerm(tbef)) { + Yap_Error(TYPE_ERROR_INTEGER, tbef, "sub_string/5"); + ReleaseAndReturn(FALSE); + } else { + minv = IntegerOfTerm(tbef); + if ((Int)minv < 0) { + Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tbef, "sub_string/5"); + ReleaseAndReturn(FALSE); + }; + mask |= SUB_ATOM_HAS_MIN; + bnds++; + } + if (IsVarTerm(tsize = Deref(ARG3))) { + len = 0; + } else if (!IsIntegerTerm(tsize)) { + Yap_Error(TYPE_ERROR_INTEGER, tsize, "sub_string/5"); + ReleaseAndReturn(FALSE); + } else { + len = IntegerOfTerm(tsize); + if ((Int)len < 0) { + Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tsize, "sub_string/5"); + ReleaseAndReturn(FALSE); + }; + mask |= SUB_ATOM_HAS_SIZE; + bnds++; + } + if (IsVarTerm(tafter = Deref(ARG4))) { + after = 0; + } else if (!IsIntegerTerm(tafter)) { + Yap_Error(TYPE_ERROR_INTEGER, tafter, "sub_string/5"); + ReleaseAndReturn(FALSE); + } else { + after = IntegerOfTerm(tafter); + if ((Int)after < 0) { + Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, tafter, "sub_string/5"); + ReleaseAndReturn(FALSE); + }; + mask |= SUB_ATOM_HAS_AFTER; + bnds++; + } + if (!IsVarTerm(tout = Deref(ARG5))) { + if (sub_atom) { + if (!IsAtomTerm(tout)) { + Yap_Error(TYPE_ERROR_ATOM, tout, "sub_atom/5"); + ReleaseAndReturn(FALSE); + } else { + Atom oat; + mask |= SUB_ATOM_HAS_VAL | SUB_ATOM_HAS_SIZE; + oat = AtomOfTerm(tout); + len = strlen_utf8(RepAtom(oat)->UStrOfAE); + } + } else { + if (!IsStringTerm(tout)) { + Yap_Error(TYPE_ERROR_STRING, tout, "sub_string/5"); + ReleaseAndReturn(FALSE); + } else { + mask |= SUB_ATOM_HAS_VAL | SUB_ATOM_HAS_SIZE; + len = strlen_utf8(UStringOfTerm(tout)); + } + } + if (!Yap_unify(ARG3, MkIntegerTerm(len))) + release_cut_fail(); + bnds += 2; + } + /* the problem is deterministic if we have two cases */ + if (bnds > 1) { + int out = FALSE; + + if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_SIZE)) == + (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_SIZE)) { + if (minv + len > sz) + release_cut_fail(); + if ((Int)(after = (sz - (minv + len))) < 0) + release_cut_fail(); + nat = build_new_atomic(mask, p, minv, len PASS_REGS); + if (!nat) + release_cut_fail(); + out = Yap_unify(ARG4, MkIntegerTerm(after)) && Yap_unify(ARG5, nat); + } else if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_AFTER)) == + (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_AFTER)) { + if (sz < minv + after) + release_cut_fail(); + len = sz - (minv + after); + nat = build_new_atomic(mask, p, minv, len PASS_REGS); + if (!nat) + release_cut_fail(); + out = Yap_unify(ARG3, MkIntegerTerm(len)) && Yap_unify(ARG5, nat); + } else if ((mask & (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_AFTER)) == + (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_AFTER)) { + if (len + after > sz) + release_cut_fail(); + minv = sz - (len + after); + nat = build_new_atomic(mask, p, minv, len PASS_REGS); + if (!nat) + release_cut_fail(); + out = Yap_unify(ARG2, MkIntegerTerm(minv)) && Yap_unify(ARG5, nat); + } else if ((mask & (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_VAL)) == + (SUB_ATOM_HAS_MIN | SUB_ATOM_HAS_VAL)) { + if (sub_atom) + out = check_sub_atom_at(minv, at, AtomOfTerm(nat), len); + else + out = check_sub_string_at(minv, p, UStringOfTerm(nat), len); + } else if ((mask & (SUB_ATOM_HAS_AFTER | SUB_ATOM_HAS_VAL)) == + (SUB_ATOM_HAS_AFTER | SUB_ATOM_HAS_VAL)) { + if (sub_atom) + out = check_sub_atom_bef(sz - after, at, AtomOfTerm(nat)); + else + out = check_sub_string_bef(sz - after, tat1, tout); + } else if ((mask & (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_VAL)) == + (SUB_ATOM_HAS_SIZE | SUB_ATOM_HAS_VAL)) { + if (!sub_atom) { + out = (strlen_utf8(UStringOfTerm(tout)) == len); + if (!out) + release_cut_fail(); + } else { + out = (strlen(RepAtom(AtomOfTerm(tout))->StrOfAE) == len); + if (!out) + release_cut_fail(); + } + if (len == sz) { + out = out && Yap_unify(ARG1, ARG5) && + Yap_unify(ARG2, MkIntegerTerm(0)) && + Yap_unify(ARG4, MkIntegerTerm(0)); + } else if (len > sz) { release_cut_fail(); } else { - if (!(mask & SUB_ATOM_HAS_MIN)) - minv = 0; - if (!(mask & SUB_ATOM_HAS_SIZE)) - len = 0; - if (!(mask & SUB_ATOM_HAS_AFTER)) - after = sz - (len + minv); + mask |= SUB_ATOM_HAS_SIZE; + minv = 0; + after = sz - len; + goto backtrackable; } - backtrackable: - EXTRA_CBACK_ARG(5, 1) = MkIntegerTerm(mask); - EXTRA_CBACK_ARG(5, 2) = MkIntegerTerm(minv); - EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(len); - EXTRA_CBACK_ARG(5, 4) = MkIntegerTerm(after); - EXTRA_CBACK_ARG(5, 5) = MkIntegerTerm(sz); - ReleaseAndReturn(cont_sub_atomic(PASS_REGS1)); } + if (out) + release_cut_succeed(); + release_cut_fail(); + } else { + if (!(mask & SUB_ATOM_HAS_MIN)) + minv = 0; + if (!(mask & SUB_ATOM_HAS_SIZE)) + len = 0; + if (!(mask & SUB_ATOM_HAS_AFTER)) + after = sz - (len + minv); + } +backtrackable: + EXTRA_CBACK_ARG(5, 1) = MkIntegerTerm(mask); + EXTRA_CBACK_ARG(5, 2) = MkIntegerTerm(minv); + EXTRA_CBACK_ARG(5, 3) = MkIntegerTerm(len); + EXTRA_CBACK_ARG(5, 4) = MkIntegerTerm(after); + EXTRA_CBACK_ARG(5, 5) = MkIntegerTerm(sz); + ReleaseAndReturn(cont_sub_atomic(PASS_REGS1)); +} - /** @pred sub_atom(+ _A_,? _Bef_, ? _Size_, ? _After_, ? _At_out_) is iso +/** @pred sub_atom(+ _A_,? _Bef_, ? _Size_, ? _After_, ? _At_out_) is iso - True when _A_ and _At_out_ are atoms such that the name of - _At_out_ has size _Size_ and is a sub-string of the name of - _A_, such that _Bef_ is the number of characters before and - _After_ the number of characters afterwards. +True when _A_ and _At_out_ are atoms such that the name of + _At_out_ has size _Size_ and is a sub-string of the name of + _A_, such that _Bef_ is the number of characters before and + _After_ the number of characters afterwards. - Note that _A_ must always be known, but _At_out_ can be unbound when - calling this built-in. If all the arguments for sub_atom/5 but _A_ - are unbound, the built-in will backtrack through all possible - sub-strings of _A_. +Note that _A_ must always be known, but _At_out_ can be unbound when +calling this built-in. If all the arguments for sub_atom/5 but _A_ +are unbound, the built-in will backtrack through all possible +sub-strings of _A_. - */ - static Int sub_atom(USES_REGS1) { - return (sub_atomic(true, false PASS_REGS)); - } + */ +static Int sub_atom(USES_REGS1) { return (sub_atomic(true, false PASS_REGS)); } - /** @pred sub_string(+ _S_,? _Bef_, ? _Size_, ? _After_, ? _S_out_) is - iso +/** @pred sub_string(+ _S_,? _Bef_, ? _Size_, ? _After_, ? _S_out_) is +iso - True when _S_ and _S_out_ are strings such that the - _S_out_ has size _Size_ and is a sub-string of - _S_, _Bef_ is the number of characters before, and - _After_ the number of characters afterwards. +True when _S_ and _S_out_ are strings such that the + _S_out_ has size _Size_ and is a sub-string of + _S_, _Bef_ is the number of characters before, and + _After_ the number of characters afterwards. - Note that _S_ must always be known, but _S_out_ can be unbound when - calling this built-in. If all the arguments for sub_string/5 but _S_ - are unbound, the built-in will generate all possible - sub-strings of _S_. +Note that _S_ must always be known, but _S_out_ can be unbound when +calling this built-in. If all the arguments for sub_string/5 but _S_ +are unbound, the built-in will generate all possible +sub-strings of _S_. - */ - static Int sub_string(USES_REGS1) { - return sub_atomic(false, true PASS_REGS); - } + */ +static Int sub_string(USES_REGS1) { return sub_atomic(false, true PASS_REGS); } +static Int cont_current_atom(USES_REGS1) { + Atom catom; + Int i = IntOfTerm(EXTRA_CBACK_ARG(1, 2)); + AtomEntry *ap; /* nasty hack for gcc on hpux */ - static Int atomic_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsAtomicTerm(t1)) { - Yap_Error(TYPE_ERROR_ATOMIC, t1, "read_term_from_atomic/3"); - return (FALSE); - } else { - Term t = Yap_AtomicToString(t1 PASS_REGS); - s = (const char *)UStringOfTerm(t); - len = strlen_utf8((unsigned char *)s); + /* protect current hash table line */ + if (IsAtomTerm(EXTRA_CBACK_ARG(1, 1))) + catom = AtomOfTerm(EXTRA_CBACK_ARG(1, 1)); + else + catom = NIL; + if (catom == NIL) { + i++; + /* move away from current hash table line */ + while (i < AtomHashTableSize) { + READ_LOCK(HashChain[i].AERWLock); + catom = HashChain[i].Entry; + READ_UNLOCK(HashChain[i].AERWLock); + if (catom != NIL) { + break; } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); + i++; } - - static Int atom_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsAtomTerm(t1)) { - Yap_Error(TYPE_ERROR_ATOM, t1, "read_term_from_atomic/3"); - return (FALSE); - } else { - Term t = Yap_AtomicToString(t1 PASS_REGS); - s = StringOfTerm(t); - len = strlen_utf8((const unsigned char *)s); - } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); + if (i == AtomHashTableSize) { + cut_fail(); } - - - static Int string_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsStringTerm(t1)) { - Yap_Error(TYPE_ERROR_STRING, t1, "read_term_from_string/3"); - return (FALSE); - } else { - s = StringOfTerm(t1); - len = strlen_utf8((const unsigned char *)s); - } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); - } - - static Int cont_current_atom(USES_REGS1) { - Atom catom; - Int i = IntOfTerm(EXTRA_CBACK_ARG(1, 2)); - AtomEntry *ap; /* nasty hack for gcc on hpux */ - - /* protect current hash table line */ - if (IsAtomTerm(EXTRA_CBACK_ARG(1, 1))) - catom = AtomOfTerm(EXTRA_CBACK_ARG(1, 1)); - else - catom = NIL; - if (catom == NIL) { + } + ap = RepAtom(catom); + if (Yap_unify_constant(ARG1, MkAtomTerm(catom))) { + READ_LOCK(ap->ARWLock); + if (ap->NextOfAE == NIL) { + READ_UNLOCK(ap->ARWLock); + i++; + while (i < AtomHashTableSize) { + READ_LOCK(HashChain[i].AERWLock); + catom = HashChain[i].Entry; + READ_UNLOCK(HashChain[i].AERWLock); + if (catom != NIL) { + break; + } i++; - /* move away from current hash table line */ - while (i < AtomHashTableSize) { - READ_LOCK(HashChain[i].AERWLock); - catom = HashChain[i].Entry; - READ_UNLOCK(HashChain[i].AERWLock); - if (catom != NIL) { - break; - } - i++; - } - if (i == AtomHashTableSize) { - cut_fail(); - } } - ap = RepAtom(catom); - if (Yap_unify_constant(ARG1, MkAtomTerm(catom))) { - READ_LOCK(ap->ARWLock); - if (ap->NextOfAE == NIL) { - READ_UNLOCK(ap->ARWLock); - i++; - while (i < AtomHashTableSize) { - READ_LOCK(HashChain[i].AERWLock); - catom = HashChain[i].Entry; - READ_UNLOCK(HashChain[i].AERWLock); - if (catom != NIL) { - break; - } - i++; - } - if (i == AtomHashTableSize) { - cut_fail(); - } else { - EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(catom); - } - } else { - EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(ap->NextOfAE); - READ_UNLOCK(ap->ARWLock); - } - EXTRA_CBACK_ARG(1, 2) = MkIntTerm(i); - return (TRUE); + if (i == AtomHashTableSize) { + cut_fail(); } else { - return (FALSE); + EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(catom); } + } else { + EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(ap->NextOfAE); + READ_UNLOCK(ap->ARWLock); } + EXTRA_CBACK_ARG(1, 2) = MkIntTerm(i); + return (TRUE); + } else { + return (FALSE); + } +} - static Int current_atom(USES_REGS1) { /* current_atom(?Atom) - */ - Term t1 = Deref(ARG1); - if (!IsVarTerm(t1)) { - if (IsAtomTerm(t1)) - cut_succeed(); - else - cut_fail(); - } - READ_LOCK(HashChain[0].AERWLock); - if (HashChain[0].Entry != NIL) { - EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(HashChain[0].Entry); - } else { - EXTRA_CBACK_ARG(1, 1) = MkIntTerm(0); - } - READ_UNLOCK(HashChain[0].AERWLock); - EXTRA_CBACK_ARG(1, 2) = MkIntTerm(0); - return (cont_current_atom(PASS_REGS1)); - } +static Int current_atom(USES_REGS1) { /* current_atom(?Atom) + */ + Term t1 = Deref(ARG1); + if (!IsVarTerm(t1)) { + if (IsAtomTerm(t1)) + cut_succeed(); + else + cut_fail(); + } + READ_LOCK(HashChain[0].AERWLock); + if (HashChain[0].Entry != NIL) { + EXTRA_CBACK_ARG(1, 1) = MkAtomTerm(HashChain[0].Entry); + } else { + EXTRA_CBACK_ARG(1, 1) = MkIntTerm(0); + } + READ_UNLOCK(HashChain[0].AERWLock); + EXTRA_CBACK_ARG(1, 2) = MkIntTerm(0); + return (cont_current_atom(PASS_REGS1)); +} - void Yap_InitBackAtoms(void) { - Yap_InitCPredBack("$current_atom", 1, 2, current_atom, cont_current_atom, - SafePredFlag | SyncPredFlag); - Yap_InitCPredBack("atom_concat", 3, 2, atom_concat3, cont_atom_concat3, - 0); - Yap_InitCPredBack("atomic_concat", 3, 2, atomic_concat3, - cont_atomic_concat3, 0); - Yap_InitCPredBack("string_concat", 3, 2, string_concat3, - cont_string_concat3, 0); - Yap_InitCPredBack("sub_atom", 5, 5, sub_atom, cont_sub_atomic, 0); - Yap_InitCPredBack("sub_string", 5, 5, sub_string, cont_sub_atomic, 0); - Yap_InitCPredBack("string_code", 3, 1, string_code3, cont_string_code3, - 0); - } +void Yap_InitBackAtoms(void) { + Yap_InitCPredBack("$current_atom", 1, 2, current_atom, cont_current_atom, + SafePredFlag | SyncPredFlag); + Yap_InitCPredBack("atom_concat", 3, 2, atom_concat3, cont_atom_concat3, 0); + Yap_InitCPredBack("atomic_concat", 3, 2, atomic_concat3, cont_atomic_concat3, + 0); + Yap_InitCPredBack("string_concat", 3, 2, string_concat3, cont_string_concat3, + 0); + Yap_InitCPredBack("sub_atom", 5, 5, sub_atom, cont_sub_atomic, 0); + Yap_InitCPredBack("sub_string", 5, 5, sub_string, cont_sub_atomic, 0); + Yap_InitCPredBack("string_code", 3, 1, string_code3, cont_string_code3, 0); +} - void Yap_InitAtomPreds(void) { - Yap_InitCPred("name", 2, name, 0); - /** @pred name( _A_, _L_) +void Yap_InitAtomPreds(void) { + Yap_InitCPred("name", 2, name, 0); + /** @pred name( _A_, _L_) - The predicate holds when at least one of the arguments is ground - (otherwise, an error message will be displayed). The argument _A_ will - be unified with an atomic symbol and _L_ with the list of the ASCII - codes for the characters of the external representation of _A_. + The predicate holds when at least one of the arguments is ground + (otherwise, an error message will be displayed). The argument _A_ will + be unified with an atomic symbol and _L_ with the list of the ASCII + codes for the characters of the external representation of _A_. - ~~~~~{.prolog} - name(yap,L). - ~~~~~ - will return: + ~~~~~{.prolog} + name(yap,L). + ~~~~~ + will return: - ~~~~~{.prolog} - L = [121,97,112]. - ~~~~~ - and + ~~~~~{.prolog} + L = [121,97,112]. + ~~~~~ + and - ~~~~~{.prolog} - name(3,L). - ~~~~~ - will return: + ~~~~~{.prolog} + name(3,L). + ~~~~~ + will return: - ~~~~~{.prolog} - L = [51]. - ~~~~~ + ~~~~~{.prolog} + L = [51]. + ~~~~~ - */ - Yap_InitCPred("string_to_atom", 2, string_to_atom, 0); - Yap_InitCPred("atom_string", 2, atom_string, 0); - Yap_InitCPred("string_to_atomic", 2, string_to_atomic, 0); - Yap_InitCPred("string_to_list", 2, string_to_list, 0); - Yap_InitCPred("char_code", 2, char_code, SafePredFlag); - /** @pred char_code(? _A_,? _I_) is iso - - - The built-in succeeds with _A_ bound to character represented as an - atom, and _I_ bound to the character code represented as an - integer. At least, one of either _A_ or _I_ must be bound before - the call. - - - */ - - Yap_InitCPred("atom_to_term", 3, atom_to_term, 0); - Yap_InitCPred("atomic_to_term", 3, atomic_to_term, 0); - Yap_InitCPred("string_to_term", 3, string_to_term, 0); - - Yap_InitCPred("atom_chars", 2, atom_chars, 0); - /** @pred atom_chars(? _A_,? _L_) is iso - - - The predicate holds when at least one of the arguments is ground - (otherwise, an error message will be displayed). The argument _A_ must - be unifiable with an atom, and the argument _L_ with the list of the - characters of _A_. - - - */ - Yap_InitCPred("atom_codes", 2, atom_codes, 0); - Yap_InitCPred("string_codes", 2, string_codes, 0); - Yap_InitCPred("string_chars", 2, string_chars, 0); - Yap_InitCPred("atom_length", 2, atom_length, SafePredFlag); - /** @pred atom_length(+ _A_,? _I_) is iso - - - The predicate holds when the first argument is an atom, and the second - unifies with the number of characters forming that atom. - - - */ - Yap_InitCPred("atomic_length", 2, atomic_length, SafePredFlag); - Yap_InitCPred("string_length", 2, string_length, SafePredFlag); - Yap_InitCPred("$atom_split", 4, atom_split, SafePredFlag); - Yap_InitCPred("number_chars", 2, number_chars, 0); - Yap_InitCPred("number_atom", 2, number_atom, 0); - /** @pred number_atom(? _I_,? _L_) - - - - The predicate holds when at least one of the arguments is ground - (otherwise, an error message will be displayed). The argument _I_ must - be unifiable with a number, and the argument _L_ must be unifiable - with an atom representing the number. - - - */ - Yap_InitCPred("number_string", 2, number_string, 0); - Yap_InitCPred("number_codes", 2, number_codes, 0); - Yap_InitCPred("atom_number", 2, atom_number, 0); - /** @pred atom_number(? _Atom_,? _Number_) - - - The predicate holds when at least one of the arguments is ground - (otherwise, an error message will be displayed). If the argument - _Atom_ is an atom, _Number_ must be the number corresponding - to the characters in _Atom_, otherwise the characters in - _Atom_ must encode a number _Number_. - - - */ - Yap_InitCPred("string_number", 2, string_number, 0); - Yap_InitCPred("$atom_concat", 2, atom_concat2, 0); - Yap_InitCPred("$string_concat", 2, string_concat2, 0); - Yap_InitCPred("atomic_concat", 2, atomic_concat2, 0); - /** @pred atomic_concat(+ _As_,? _A_) - - - The predicate holds when the first argument is a list of atomic terms, - and - the second unifies with the atom obtained by concatenating all the - atomic terms in the first list. The first argument thus may contain - atoms or numbers. - - - */ - Yap_InitCPred("atomics_to_string", 2, atomics_to_string2, 0); - Yap_InitCPred("atomics_to_string", 3, atomics_to_string3, 0); - Yap_InitCPred("get_string_code", 3, get_string_code3, 0); - - Yap_InitCPred("downcase_text_to_atom", 2, downcase_text_to_atom, 0); - Yap_InitCPred("downcase_atom", 2, downcase_text_to_atom, 0); - Yap_InitCPred("upcase_text_to_atom", 2, upcase_text_to_atom, 0); - Yap_InitCPred("upcase_atom", 2, upcase_text_to_atom, 0); - Yap_InitCPred("downcase_text_to_string", 2, downcase_text_to_string, 0); - Yap_InitCPred("upcase_text_to_string", 2, upcase_text_to_string, 0); - Yap_InitCPred("downcase_text_to_codes", 2, downcase_text_to_codes, 0); - Yap_InitCPred("upcase_text_to_codes", 2, upcase_text_to_codes, 0); - Yap_InitCPred("downcase_text_to_chars", 2, downcase_text_to_chars, 0); - Yap_InitCPred("upcase_text_to_chars", 2, upcase_text_to_chars, 0); - - /* hiding and unhiding some predicates */ - Yap_InitCPred("hide_atom", 1, hide_atom, SafePredFlag | SyncPredFlag); - Yap_InitCPred("hide", 1, hide_atom, SafePredFlag | SyncPredFlag); - Yap_InitCPred("unhide_atom", 1, unhide_atom, SafePredFlag | SyncPredFlag); - Yap_InitCPred("$hidden_atom", 1, hidden_atom, - HiddenPredFlag | SafePredFlag | SyncPredFlag); - } - - /** - @} */ + Yap_InitCPred("string_to_atom", 2, string_to_atom, 0); + Yap_InitCPred("atom_string", 2, atom_string, 0); + Yap_InitCPred("string_to_atomic", 2, string_to_atomic, 0); + Yap_InitCPred("string_to_list", 2, string_to_list, 0); + Yap_InitCPred("char_code", 2, char_code, SafePredFlag); + /** @pred char_code(? _A_,? _I_) is iso + + + The built-in succeeds with _A_ bound to character represented as an + atom, and _I_ bound to the character code represented as an + integer. At least, one of either _A_ or _I_ must be bound before + the call. + + + */ + Yap_InitCPred("atom_chars", 2, atom_chars, 0); + /** @pred atom_chars(? _A_,? _L_) is iso + + + The predicate holds when at least one of the arguments is ground + (otherwise, an error message will be displayed). The argument _A_ must + be unifiable with an atom, and the argument _L_ with the list of the + characters of _A_. + + + */ + Yap_InitCPred("atom_codes", 2, atom_codes, 0); + Yap_InitCPred("string_codes", 2, string_codes, 0); + Yap_InitCPred("string_chars", 2, string_chars, 0); + Yap_InitCPred("atom_length", 2, atom_length, SafePredFlag); + /** @pred atom_length(+ _A_,? _I_) is iso + + + The predicate holds when the first argument is an atom, and the second + unifies with the number of characters forming that atom. + + + */ + Yap_InitCPred("atomic_length", 2, atomic_length, SafePredFlag); + Yap_InitCPred("string_length", 2, string_length, SafePredFlag); + Yap_InitCPred("$atom_split", 4, atom_split, SafePredFlag); + Yap_InitCPred("number_chars", 2, number_chars, 0); + Yap_InitCPred("number_atom", 2, number_atom, 0); + /** @pred number_atom(? _I_,? _L_) + + + + The predicate holds when at least one of the arguments is ground + (otherwise, an error message will be displayed). The argument _I_ must + be unifiable with a number, and the argument _L_ must be unifiable + with an atom representing the number. + + + */ + Yap_InitCPred("number_string", 2, number_string, 0); + Yap_InitCPred("number_codes", 2, number_codes, 0); + Yap_InitCPred("atom_number", 2, atom_number, 0); + /** @pred atom_number(? _Atom_,? _Number_) + + + The predicate holds when at least one of the arguments is ground + (otherwise, an error message will be displayed). If the argument + _Atom_ is an atom, _Number_ must be the number corresponding + to the characters in _Atom_, otherwise the characters in + _Atom_ must encode a number _Number_. + + + */ + Yap_InitCPred("string_number", 2, string_number, 0); + Yap_InitCPred("$atom_concat", 2, atom_concat2, 0); + Yap_InitCPred("$string_concat", 2, string_concat2, 0); + Yap_InitCPred("atomic_concat", 2, atomic_concat2, 0); + /** @pred atomic_concat(+ _As_,? _A_) + + + The predicate holds when the first argument is a list of atomic terms, + and + the second unifies with the atom obtained by concatenating all the + atomic terms in the first list. The first argument thus may contain + atoms or numbers. + + + */ + Yap_InitCPred("atomics_to_string", 2, atomics_to_string2, 0); + Yap_InitCPred("atomics_to_string", 3, atomics_to_string3, 0); + Yap_InitCPred("get_string_code", 3, get_string_code3, 0); + + Yap_InitCPred("downcase_text_to_atom", 2, downcase_text_to_atom, 0); + Yap_InitCPred("downcase_atom", 2, downcase_text_to_atom, 0); + Yap_InitCPred("upcase_text_to_atom", 2, upcase_text_to_atom, 0); + Yap_InitCPred("upcase_atom", 2, upcase_text_to_atom, 0); + Yap_InitCPred("downcase_text_to_string", 2, downcase_text_to_string, 0); + Yap_InitCPred("upcase_text_to_string", 2, upcase_text_to_string, 0); + Yap_InitCPred("downcase_text_to_codes", 2, downcase_text_to_codes, 0); + Yap_InitCPred("upcase_text_to_codes", 2, upcase_text_to_codes, 0); + Yap_InitCPred("downcase_text_to_chars", 2, downcase_text_to_chars, 0); + Yap_InitCPred("upcase_text_to_chars", 2, upcase_text_to_chars, 0); + + /* hiding and unhiding some predicates */ + Yap_InitCPred("hide_atom", 1, hide_atom, SafePredFlag | SyncPredFlag); + Yap_InitCPred("hide", 1, hide_atom, SafePredFlag | SyncPredFlag); + Yap_InitCPred("unhide_atom", 1, unhide_atom, SafePredFlag | SyncPredFlag); + Yap_InitCPred("$hidden_atom", 1, hidden_atom, + HiddenPredFlag | SafePredFlag | SyncPredFlag); +} + +/** +@} +*/ diff --git a/C/attvar.c b/C/attvar.c index a2627a09e..e6045e8d8 100644 --- a/C/attvar.c +++ b/C/attvar.c @@ -28,10 +28,11 @@ static char SccsId[] = "%W% %G%"; #define NULL (void *)0 #endif -/** @{ */ +/** @file attvars.c + @{ */ -/** @defgroup AttributeVariables_Builtins Implementation of Attribute - Declarations +/** + * @defgroup AttributeVariables_Builtins Implementation of Attribute Declarations @ingroup AttributeVariables */ diff --git a/C/bignum.c b/C/bignum.c index f0a7b0367..3da5acf1d 100644 --- a/C/bignum.c +++ b/C/bignum.c @@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%"; #ifdef USE_GMP -#include "eval.h" +#include "YapEval.h" #include "alloc.h" Term diff --git a/C/c_interface.c b/C/c_interface.c index 17ec56df9..d35554ee0 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -127,8 +127,7 @@ X_API yhandle_t YAP_CurrentSlot(void); /// @brief allocate n empty new slots /// -/// Return a handle to the system's default slot. -X_API yhandle_t YAP_NewSlots(int NumberOfSlots); +/// Return a handle to the system's default slo t. iX_API yhandle_t YAP_NewSlots(int NumberOfSlots); /// @brief allocate n empty new slots /// @@ -246,6 +245,8 @@ X_API YAP_Bool YAP_IsRationalTerm(YAP_Term t) { #endif } +X_API YAP_Bool YAP_IsStringTerm(YAP_Term t) { return (IsStringTerm(t)); } + X_API YAP_Bool YAP_IsVarTerm(YAP_Term t) { return (IsVarTerm(t)); } X_API YAP_Bool YAP_IsNonVarTerm(YAP_Term t) { return (IsNonVarTerm(t)); } @@ -277,6 +278,32 @@ X_API Term YAP_MkIntTerm(Int n) { return I; } +X_API Term YAP_MkStringTerm(const char *n) { + CACHE_REGS + Term I; + BACKUP_H(); + + I = MkStringTerm(n); + RECOVER_H(); + return I; +} + +X_API Term YAP_MkUnsignedStringTerm(const unsigned char *n) { + CACHE_REGS + Term I; + BACKUP_H(); + + I = MkUStringTerm(n); + RECOVER_H(); + return I; +} + +X_API const char *YAP_StringOfTerm(Term t) { return StringOfTerm(t); } + +X_API const unsigned char *YAP_UnsignedStringOfTerm(Term t) { + return UStringOfTerm(t); +} + X_API Int YAP_IntOfTerm(Term t) { if (!IsApplTerm(t)) return IntOfTerm(t); @@ -399,11 +426,11 @@ X_API Term YAP_MkAtomTerm(Atom n) { X_API Atom YAP_AtomOfTerm(Term t) { return (AtomOfTerm(t)); } X_API bool YAP_IsWideAtom(Atom a) { - const unsigned char *s = RepAtom(a)->UStrOfAE; -int32_t v; + const unsigned char *s = RepAtom(a)->UStrOfAE; + int32_t v; while (*s) { - size_t n = get_utf8(s,1,&v); - if (n>1) + size_t n = get_utf8(s, 1, &v); + if (n > 1) return true; } return false; @@ -419,15 +446,15 @@ X_API const char *YAP_AtomName(Atom a) { X_API const wchar_t *YAP_WideAtomName(Atom a) { int32_t v; const unsigned char *s = RepAtom(a)->UStrOfAE; - size_t n = strlen_utf8( s ); - wchar_t *dest = Malloc( (n+1)* sizeof(wchar_t)), *o = dest; + size_t n = strlen_utf8(s); + wchar_t *dest = Malloc((n + 1) * sizeof(wchar_t)), *o = dest; while (*s) { - size_t n = get_utf8(s,1,&v); - if (n==0) - return NULL; + size_t n = get_utf8(s, 1, &v); + if (n == 0) + return NULL; *o++ = v; } - o[0] = '\0'; + o[0] = '\0'; return dest; } @@ -453,9 +480,8 @@ X_API Atom YAP_LookupWideAtom(const wchar_t *c) { CACHE_REGS Atom a; - while (TRUE) { - a = Yap_NWCharsToAtom(c, -1 USES_REGS); + a = Yap_NWCharsToAtom(c, -1 USES_REGS); if (a == NIL || Yap_get_signal(YAP_CDOVF_SIGNAL)) { if (!Yap_locked_growheap(FALSE, 0, NULL)) { Yap_Error(RESOURCE_ERROR_HEAP, TermNil, "YAP failed to grow heap: %s", @@ -490,10 +516,9 @@ X_API size_t YAP_AtomNameLength(Atom at) { if (IsBlob(at)) { return RepAtom(at)->rep.blob->length; } - unsigned char *c = RepAtom(at)->UStrOfAE; - - return strlen_utf8(c); + unsigned char *c = RepAtom(at)->UStrOfAE; + return strlen_utf8(c); } X_API Term YAP_MkVarTerm(void) { @@ -1376,10 +1401,14 @@ X_API Term YAP_ReadBuffer(const char *s, Term *tp) { Term tv, t; BACKUP_H(); - if (*tp) tv = *tp; else tv = 0; + if (*tp) + tv = *tp; + else + tv = 0; LOCAL_ErrorMessage = NULL; - while (!(t = Yap_StringToTerm(s, strlen(s) + 1, &LOCAL_encoding, - GLOBAL_MaxPriority,tv))) { + const unsigned char *us = (const unsigned char *)s; + while (!(t = Yap_BufferToTermWithPrioBindings(us, strlen(s) + 1, TermNil, + GLOBAL_MaxPriority, tv))) { if (LOCAL_ErrorMessage) { if (!strcmp(LOCAL_ErrorMessage, "Stack Overflow")) { if (!Yap_dogc(0, NULL PASS_REGS)) { @@ -1636,7 +1665,6 @@ X_API PredEntry *YAP_AtomToPredInModule(Atom at, Term mod) { static int run_emulator(USES_REGS1) { int out; - LOCAL_PrologMode &= ~(UserCCallMode | CCallMode); out = Yap_absmi(0); LOCAL_PrologMode |= UserCCallMode; return out; @@ -1659,7 +1687,7 @@ X_API bool YAP_EnterGoal(PredEntry *pe, CELL *ptr, YAP_dogoalinfo *dgi) { // slot=%d", pe, pe->CodeOfPred->opc, FAILCODE, Deref(ARG1), Deref(ARG2), // LOCAL_CurSlot); dgi->b = LCL0 - (CELL *)B; - out = run_emulator(PASS_REGS1); + out = Yap_exec_absmi(true, false); RECOVER_MACHINE_REGS(); if (out) { dgi->EndSlot = LOCAL_CurSlot; @@ -2107,7 +2135,7 @@ X_API void YAP_Write(Term t, FILE *f, int flags) { RECOVER_MACHINE_REGS(); } -X_API Term YAP_CopyTerm(Term t) { +X_API YAP_Term YAP_CopyTerm(Term t) { Term tn; BACKUP_MACHINE_REGS(); @@ -2115,21 +2143,25 @@ X_API Term YAP_CopyTerm(Term t) { RECOVER_MACHINE_REGS(); - return tn; + return (tn); } X_API char *YAP_WriteBuffer(Term t, char *buf, size_t sze, int flags) { CACHE_REGS - size_t length; + seq_tv_t inp, out; + size_t length = sze; char *b; BACKUP_MACHINE_REGS(); - if ((b = Yap_TermToString(t, &length, LOCAL_encoding, flags)) != buf) { - RECOVER_MACHINE_REGS(); - return b; - } + inp.val.t = t; + inp.type = YAP_STRING_TERM; + out.type = YAP_STRING_CHARS; + out.val.c = buf; + out.enc = LOCAL_encoding; + if (!Yap_CVT_Text(&inp, &out PASS_REGS)) + return NULL; RECOVER_MACHINE_REGS(); - return buf; + return out.val.c; } /// write a a term to n user-provided buffer: make sure not tp @@ -2251,13 +2283,11 @@ static void do_bootfile(const char *bootfilename USES_REGS) { the module. */ -static bool initialized = false; +X_API bool YAP_initialized = false; static int n_mdelays = 0; static YAP_delaymodule_t *m_delays; X_API bool YAP_DelayInit(YAP_ModInit_t f, const char s[]) { - if (initialized) - return false; if (m_delays) { m_delays = realloc(m_delays, (n_mdelays + 1) * sizeof(YAP_delaymodule_t)); } else { @@ -2269,6 +2299,17 @@ X_API bool YAP_DelayInit(YAP_ModInit_t f, const char s[]) { return true; } +bool Yap_LateInit(const char s[]) { + int i; + for (i = 0; i < n_mdelays; i++) { + if (!strcmp(m_delays[i].s, s)) { + m_delays[i].f(); + return true; + } + } + return false; +} + static void start_modules(void) { Term cm = CurrentModule; size_t i; @@ -2280,7 +2321,7 @@ static void start_modules(void) { } /// whether Yap is under control of some other system -bool Yap_embedded; +bool Yap_embedded = true; /* this routine is supposed to be called from an external program that wants to control Yap */ @@ -2294,9 +2335,8 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) { const char *yroot; /* ignore repeated calls to YAP_Init */ - if (initialized) + if (YAP_initialized) return YAP_FOUND_BOOT_ERROR; - initialized = true; Yap_embedded = yap_init->Embedded; Yap_page_size = Yap_InitPageSize(); /* init memory page size, required by @@ -2304,10 +2344,12 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) { #if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA) Yap_init_yapor_global_local_memory(); #endif /* YAPOR_COPY || YAPOR_COW || YAPOR_SBA */ - GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts; - Yap_InitSysbits(0); /* init signal handling and time, required by later + // GLOBAL_PrologShouldHandleInterrupts = + // yap_init->PrologShouldHandleInterrupts && + if (!yap_init->Embedded) + Yap_InitSysbits(0); /* init signal handling and time, required by later functions */ - GLOBAL_argv = yap_init->Argv; + GLOBAL_argv = yap_init->Argv; GLOBAL_argc = yap_init->Argc; if (0 && ((YAP_QLY && yap_init->SavedState) || (YAP_BOOT_PL && (yap_init->YapPrologBootFile)))) { @@ -2368,10 +2410,10 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) { // CACHE_REGS - if (Yap_embedded) - if (yap_init->QuietMode) { - setVerbosity(TermSilent); - } + if (Yap_embedded) + if (yap_init->QuietMode) { + setVerbosity(TermSilent); + } { if (yap_init->YapPrologRCFile != NULL) { /* @@ -2489,6 +2531,7 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) { setBooleanGlobalPrologFlag(SAVED_PROGRAM_FLAG, false); } start_modules(); + YAP_initialized = true; return rc; } @@ -3209,10 +3252,10 @@ size_t YAP_UTF8_TextLength(Term t) { Term hd = HeadOfTerm(t); if (IsAtomTerm(hd)) { Atom at = AtomOfTerm(hd); - unsigned char *s = RepAtom(at)->UStrOfAE; - int32_t ch; - get_utf8(s, 1, &ch); - c = ch; + unsigned char *s = RepAtom(at)->UStrOfAE; + int32_t ch; + get_utf8(s, 1, &ch); + c = ch; } else if (IsIntegerTerm(hd)) { c = IntegerOfTerm(hd); } else { @@ -3223,8 +3266,8 @@ size_t YAP_UTF8_TextLength(Term t) { } } else if (IsAtomTerm(t)) { Atom at = AtomOfTerm(t); - sz = strlen(RepAtom(at)->StrOfAE); - } else if (IsStringTerm(t)) { + sz = strlen(RepAtom(at)->StrOfAE); + } else if (IsStringTerm(t)) { sz = strlen(StringOfTerm(t)); } return sz; diff --git a/C/cdmgr.c b/C/cdmgr.c index 65acb4b91..237347c24 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -20,7 +20,7 @@ static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98"; #include "Yap.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #include "yapio.h" #ifdef YAPOR diff --git a/CXX/_yap/__init__.pxd b/C/cdmgr.c708 in C-function cleanup_dangling_indices similarity index 100% rename from CXX/_yap/__init__.pxd rename to C/cdmgr.c708 in C-function cleanup_dangling_indices diff --git a/C/cmppreds.c b/C/cmppreds.c index 093412031..faa0970c5 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -57,7 +57,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STRING_H #include #endif @@ -83,7 +83,7 @@ static Int a_gen_ge(Term, Term); #define rfloat(X) (X > 0.0 ? 1 : (X == 0.0 ? 0 : -1)) static int cmp_atoms(Atom a1, Atom a2) { - return strcmp(RepAtom(a1)->StrOfAE, RepAtom(a2)->StrOfAE); + return strcmp(RepAtom(a1)->StrOfAE, RepAtom(a2)->StrOfAE); } static Int compare_complex(register CELL *pt0, register CELL *pt0_end, @@ -382,7 +382,7 @@ inline static Int compare(Term t1, Term t2) /* compare terms t1 and t2 */ if (f != FunctorDot) return strcmp(".", RepAtom(NameOfFunctor(f))->StrOfAE); else { - return compare_complex(RepPair(t1) - 1, RepPair(t1) + 1, RepAppl(t2) ); + return compare_complex(RepPair(t1) - 1, RepPair(t1) + 1, RepAppl(t2)); } } } @@ -595,10 +595,12 @@ inline static Int flt_cmp(Float dif) { static Int a_cmp(Term t1, Term t2 USES_REGS) { if (IsVarTerm(t1)) { - Yap_ThrowError( INSTANTIATION_ERROR, t1, 4, "while doing arithmetic comparison" ); + Yap_ArithError(INSTANTIATION_ERROR, t1, + "while doing arithmetic comparison"); } if (IsVarTerm(t2)) { - Yap_ThrowError( INSTANTIATION_ERROR, t1, 4, "while doing arithmetic comparison" ); + Yap_ArithError(INSTANTIATION_ERROR, t2, + "while doing arithmetic comparison"); } if (IsFloatTerm(t1) && IsFloatTerm(t2)) { return flt_cmp(FloatOfTerm(t1) - FloatOfTerm(t2)); @@ -621,7 +623,8 @@ static Int a_cmp(Term t1, Term t2 USES_REGS) { Float f2 = FloatOfTerm(t2); #if HAVE_ISNAN if (isnan(f2)) { - Yap_ThrowError( EVALUATION_ERROR_UNDEFINED, t2, 4, "trying to evaluate nan" ); + Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t2, + "trying to evaluate nan"); } #endif return flt_cmp(i1 - f2); @@ -636,7 +639,8 @@ static Int a_cmp(Term t1, Term t2 USES_REGS) { Float f1 = FloatOfTerm(t1); #if HAVE_ISNAN if (isnan(f1)) { - Yap_ThrowError( EVALUATION_ERROR_UNDEFINED, t1, 4, "trying to evaluate nan" ); + Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t1, + "trying to evaluate nan"); } #endif t2 = Yap_Eval(t2); @@ -652,8 +656,9 @@ static Int a_cmp(Term t1, Term t2 USES_REGS) { Float f2 = FloatOfTerm(t2); #if HAVE_ISNAN if (isnan(f2)) { - Yap_ThrowError( EVALUATION_ERROR_UNDEFINED, t2, 4, "trying to evaluate nan" ); - } + Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t2, + "trying to evaluate nan"); + } #endif return flt_cmp(f1 - f2); #ifdef USE_GMP @@ -674,7 +679,8 @@ static Int a_cmp(Term t1, Term t2 USES_REGS) { Float f2 = FloatOfTerm(t2); #if HAVE_ISNAN if (isnan(f2)) { - Yap_ThrowError( EVALUATION_ERROR_UNDEFINED, t2, 4, "trying to evaluate nan" ); + Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t2, + "trying to evaluate nan"); } #endif return Yap_gmp_cmp_big_float(t1, f2); diff --git a/C/compiler.c b/C/compiler.c index 868c588bf..04bbe70b6 100644 --- a/C/compiler.c +++ b/C/compiler.c @@ -174,7 +174,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "alloc.h" #include "clause.h" -#include "compile.h" +#include "YapCompile.h" #include "yapio.h" #if HAVE_STRING_H #include @@ -1081,7 +1081,8 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, char s[32]; Yap_bip_name(Op, s); - Yap_ThrowError( TYPE_ERROR_NUMBER, t2, "compiling %s/2 with output bound", s); + Yap_ThrowError(TYPE_ERROR_NUMBER, t2, 1, + "compiling %s/2 with output bound", s); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } @@ -1093,7 +1094,7 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, char s[32]; Yap_bip_name(Op, s); - Yap_ThrowError(INSTANTIATION_ERROR , t2, "compiling %s/3", s); + Yap_ThrowError(INSTANTIATION_ERROR, t2, 1, "compiling %s/3", s); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } @@ -1103,17 +1104,17 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, Int i2; if (!IsIntegerTerm(t2)) { - Yap_Error( TYPE_ERROR_INTEGER, t2, "compiling functor/3"); + Yap_ThrowError(TYPE_ERROR_INTEGER, t2, 1, "compiling functor/3"); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } i2 = IntegerOfTerm(t2); if (i2 < 0) { - Yap_ThrowError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO , t2, "compiling functor/3"); + Yap_ThrowError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, t2, + "compiling functor/3"); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); - } if (IsNumTerm(t1)) { /* we will always fail */ @@ -1122,9 +1123,8 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, } else if (!IsAtomTerm(t1)) { char s[32]; - LOCAL_Error_TYPE = TYPE_ERROR_ATOM; Yap_bip_name(Op, s); - sprintf(LOCAL_ErrorMessage, "compiling functor/3"); + Yap_ThrowError(TYPE_ERROR_ATOM, t2, 4, "compiling functor/3"); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } @@ -1178,9 +1178,8 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, else { char s[32]; - LOCAL_Error_TYPE = TYPE_ERROR_INTEGER; Yap_bip_name(Op, s); - sprintf(LOCAL_ErrorMessage, "compiling %s/2", s); + Yap_ThrowError(TYPE_ERROR_INTEGER, t1, 1, "compiling %s/2", s); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } @@ -1190,6 +1189,8 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, LOCAL_Error_TYPE = TYPE_ERROR_COMPOUND; Yap_bip_name(Op, s); + Yap_ThrowError(TYPE_ERROR_COMPOUND, t2, 1, "compiling %s/2", 1, s); + save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } else if (IsApplTerm(t2)) { @@ -1476,7 +1477,7 @@ static void c_goal(Term Goal, Term mod, compiler_struct *cglobs) { PredEntry *p; Prop p0; - Goal = Yap_YapStripModule( Goal, &mod); + Goal = Yap_YapStripModule(Goal, &mod); if (IsVarTerm(Goal)) { Goal = Yap_MkApplTerm(FunctorCall, 1, &Goal); } else if (IsNumTerm(Goal)) { diff --git a/C/computils.c b/C/computils.c index 82b4e1189..3bf9ab27a 100644 --- a/C/computils.c +++ b/C/computils.c @@ -54,13 +54,13 @@ static char SccsId[] = "%W% %G%"; /* * This file includes a set of utilities, useful to the several compilation - * modules + * modules */ #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "compile.h" +#include "YapCompile.h" #include "yapio.h" #if HAVE_STRING_H #include @@ -69,7 +69,7 @@ static char SccsId[] = "%W% %G%"; /* * The compiler creates an instruction chain which will be assembled after - * afterwards + * afterwards */ @@ -146,7 +146,7 @@ AllocCMem (UInt size, struct intermediates *cip) LOCAL_Error_Size = 256+((char *)cip->freep - (char *)HR); save_machine_regs(); siglongjmp(cip->CompilerBotch, OUT_OF_STACK_BOTCH); - } + } p = cip->freep; cip->freep += size; return p; @@ -216,7 +216,7 @@ is_a_test(Term arg, Term mod) return TRUE; } return FALSE; - } + } return pe->PredFlags & (TestPredFlag|BinaryPredFlag); } } @@ -315,7 +315,7 @@ Yap_emit_6ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE p->rnd1 = r1; p->rnd2 = r2; p->rnd3 = r3; - p->rnd4 = r4; + p->rnd4 = r4; p->rnd5 = r5; p->rnd6 = r6; p->nextInst = NIL; @@ -337,7 +337,7 @@ Yap_emit_7ops (compiler_vm_op o, CELL r1, CELL r2, CELL r3, CELL r4, CELL r5, CE p->rnd1 = r1; p->rnd2 = r2; p->rnd3 = r3; - p->rnd4 = r4; + p->rnd4 = r4; p->rnd5 = r5; p->rnd6 = r6; p->rnd7 = r7; @@ -520,7 +520,7 @@ write_special_label(special_label_op arg, special_label_id rn, UInt lab) Yap_DebugErrorPuts("fail"); break; } - } + } } static void @@ -616,7 +616,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc) Yap_DebugPlWrite(MkIntegerTerm((Int)(*ptr++))); } } - break; + break; case 'l': write_address (arg); break; @@ -645,7 +645,7 @@ ShowOp (compiler_vm_op ic, const char *f, struct PSEUDO *cpc) Yap_DebugPlWrite (MkIntTerm ((v->NoOfVE) & MaskVarAdrs)); } } - break; + break; case 'N': { Ventry *v; @@ -795,4 +795,3 @@ Yap_ShowCode (struct intermediates *cint) } #endif /* DEBUG */ - diff --git a/C/depth_bound.c b/C/depth_bound.c index b9e253dfd..a920542fd 100644 --- a/C/depth_bound.c +++ b/C/depth_bound.c @@ -22,7 +22,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #ifdef DEPTH_LIMIT diff --git a/C/errors.c b/C/errors.c index 7f749141b..ba62468c5 100755 --- a/C/errors.c +++ b/C/errors.c @@ -207,7 +207,7 @@ void Yap_RestartYap(int flag) { #if PUSH_REGS restore_absmi_regs(&Yap_standard_regs); #endif - siglongjmp(LOCAL_RestartEnv, 1); + siglongjmp(*LOCAL_RestartEnv, 1); } static void error_exit_yap(int value) { @@ -311,24 +311,24 @@ yap_error_descriptor_t *Yap_popErrorContext(void) { } void Yap_ThrowError__(const char *file, const char *function, int lineno, - yap_error_number type, Term where, ...) { - va_list ap; - char tmpbuf[MAXPATHLEN]; + yap_error_number type, Term where, ...) { + va_list ap; + char tmpbuf[MAXPATHLEN]; - va_start(ap, where); - char *format = va_arg(ap, char *); - if (format != NULL) { + va_start(ap, where); + char *format = va_arg(ap, char *); + if (format != NULL) { #if HAVE_VSNPRINTF - (void)vsnprintf(tmpbuf, MAXPATHLEN - 1, format, ap); + (void)vsnprintf(tmpbuf, MAXPATHLEN - 1, format, ap); #else - (void)vsprintf(tnpbuf, format, ap); + (void)vsprintf(tnpbuf, format, ap); #endif - // fprintf(stderr, "warning: "); -Yap_Error__(file, function, lineno, type, where, tmpbuf); - } else { - Yap_Error__(file, function, lineno, type, where); - } - siglongjmp(LOCAL_RestartEnv, 4); + // fprintf(stderr, "warning: "); + Yap_Error__(file, function, lineno, type, where, tmpbuf); + } else { + Yap_Error__(file, function, lineno, type, where); + } + siglongjmp(*LOCAL_RestartEnv, 4); } /** diff --git a/C/eval.c b/C/eval.c index b4c08d13d..a16a4916b 100644 --- a/C/eval.c +++ b/C/eval.c @@ -31,7 +31,7 @@ static char SccsId[] = "%W% %G%"; #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STDARG_H #include #endif diff --git a/C/exec.c b/C/exec.c index 681e8e408..98e4dc532 100755 --- a/C/exec.c +++ b/C/exec.c @@ -48,7 +48,7 @@ static choiceptr cp_from_integer(Term cpt USES_REGS) { */ Term Yap_cp_as_integer(choiceptr cp) { CACHE_REGS - return cp_as_integer(cp PASS_REGS); + return cp_as_integer(cp PASS_REGS); } /** @@ -128,7 +128,7 @@ inline static bool CallMetaCall(Term t, Term mod USES_REGS) { */ Term Yap_ExecuteCallMetaCall(Term mod) { CACHE_REGS - Term ts[4]; + Term ts[4]; ts[0] = ARG1; ts[1] = cp_as_integer(B PASS_REGS); /* p_current_choice_point */ ts[2] = ARG1; @@ -141,8 +141,8 @@ Term Yap_ExecuteCallMetaCall(Term mod) { Term Yap_PredicateIndicator(Term t, Term mod) { CACHE_REGS - // generate predicate indicator in this case - Term ti[2]; + // generate predicate indicator in this case + Term ti[2]; t = Yap_YapStripModule(t, &mod); if (IsApplTerm(t) && !IsExtensionFunctor(FunctorOfTerm(t))) { ti[0] = MkAtomTerm(NameOfFunctor(FunctorOfTerm(t))); @@ -210,12 +210,12 @@ static Int save_env_b(USES_REGS1) { } /** Look for a predicate with same functor as t, - create a new one of it cannot find it. - */ + create a new one of it cannot find it. +*/ static PredEntry *new_pred(Term t, Term tmod, char *pname) { Term t0 = t; -restart: + restart: if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, t0, pname); return NULL; @@ -273,7 +273,7 @@ inline static bool do_execute(Term t, Term mod USES_REGS) { Term t0 = t; t = Yap_YapStripModule(t, &mod); /* first do predicate expansion, even before you process signals. - This way you don't get to spy goal_expansion(). */ + This way you don't get to spy goal_expansion(). */ if (Yap_has_a_signal() && !LOCAL_InterruptsDisabled && !(LOCAL_PrologMode & (AbortMode | InterruptMode | SystemMode))) { return EnterCreepMode(t, mod PASS_REGS); @@ -315,9 +315,9 @@ inline static bool do_execute(Term t, Term mod USES_REGS) { /* I cannot use the standard macro here because otherwise I would dereference the argument and might skip a svar */ - if (pen->PredFlags & MetaPredFlag) { - return CallMetaCall(t, mod PASS_REGS); - } + if (pen->PredFlags & MetaPredFlag) { + return CallMetaCall(t, mod PASS_REGS); + } pt = RepAppl(t) + 1; for (i = 1; i <= arity; i++) { #if YAPOR_SBA @@ -393,7 +393,7 @@ inline static bool do_execute_n(Term t, Term mod, unsigned int n USES_REGS) { int j = -n; Term t0 = t; -restart_exec: + restart_exec: if (IsVarTerm(t)) { return CallError(INSTANTIATION_ERROR, t0, mod PASS_REGS); } else if (IsAtomTerm(t)) { @@ -432,8 +432,8 @@ restart_exec: } if (Yap_has_a_signal() && !LOCAL_InterruptsDisabled) { return EnterCreepMode( - copy_execn_to_heap(f, pt, n, arity, CurrentModule PASS_REGS), - mod PASS_REGS); + copy_execn_to_heap(f, pt, n, arity, CurrentModule PASS_REGS), + mod PASS_REGS); } if (arity > MaxTemps) { return CallError(TYPE_ERROR_CALLABLE, t, mod PASS_REGS); @@ -650,7 +650,7 @@ static Int execute_clause(USES_REGS1) { /* '$execute_clause'(Goal) */ yamop *code; Term clt = Deref(ARG3); -restart_exec: + restart_exec: if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1"); return FALSE; @@ -746,7 +746,7 @@ static void prune_inner_computation(choiceptr parent) { cut_pt = B; while (cut_pt < parent) { /* make sure we - e C-choicepoints */ + e C-choicepoints */ if (POP_CHOICE_POINT(cut_pt->cp_b)) { POP_EXECUTE(); } @@ -791,7 +791,7 @@ static void complete_inner_computation(choiceptr old_B) { static inline Term *GetTermAddress(CELL a) { Term *b = NULL; -restart: + restart: if (!IsVarTerm(a)) { return (b); } else if (a == (CELL)b) { @@ -845,8 +845,8 @@ static bool exit_set_call(execution_port exec_result, choiceptr B0, yamop *oCP, Term rc; switch (exec_result) { - // we failed - // Exception: we'll pass it through + // we failed + // Exception: we'll pass it through case CALLED_FROM_EXCEPTION: // internal exception { @@ -905,8 +905,8 @@ static bool exit_set_call(execution_port exec_result, choiceptr B0, yamop *oCP, choiceptr saved_b = B; CELL *pt = ASP; CUT_C_PUSH( - NEXTOP(NEXTOP(PredProtectStack->cs.p_code.FirstClause, OtapFs), OtapFs), - pt); // this is where things get complicated, we need to + NEXTOP(NEXTOP(PredProtectStack->cs.p_code.FirstClause, OtapFs), OtapFs), + pt); // this is where things get complicated, we need to // protect the stack and be able to backtrack pt -= 4; pt[3] = t4; @@ -955,7 +955,7 @@ static Int protect_stack_from_cut(USES_REGS1) { * @param USES_REGS1 [env for threaded execution] * @return c [next answer] - */ +*/ static Int protect_stack_from_retry(USES_REGS1) { // called after backtracking.. // @@ -1091,9 +1091,9 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { static bool complete_ge(bool out, Term omod, yhandle_t sl, bool creeping) { CACHE_REGS - if (creeping) { - Yap_signal(YAP_CREEP_SIGNAL); - } + if (creeping) { + Yap_signal(YAP_CREEP_SIGNAL); + } CurrentModule = omod; Yap_CloseSlots(sl); if (out) { @@ -1123,7 +1123,7 @@ static Int _user_expand_goal(USES_REGS1) { ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args); ARG2 = Yap_GetFromSlot(h2); if ((pe = RepPredProp( - Yap_GetPredPropByFunc(FunctorGoalExpansion2, SYSTEM_MODULE))) && + Yap_GetPredPropByFunc(FunctorGoalExpansion2, SYSTEM_MODULE))) && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL, false PASS_REGS)) { return complete_ge(true, omod, sl, creeping); @@ -1133,7 +1133,7 @@ static Int _user_expand_goal(USES_REGS1) { ARG3 = Yap_GetFromSlot(h2); /* user:goal_expansion(A,CurMod,B) */ if ((pe = RepPredProp( - Yap_GetPredPropByFunc(FunctorGoalExpansion, USER_MODULE))) && + Yap_GetPredPropByFunc(FunctorGoalExpansion, USER_MODULE))) && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL PASS_REGS, false)) { return complete_ge(true, omod, sl, creeping); @@ -1145,7 +1145,7 @@ static Int _user_expand_goal(USES_REGS1) { /* user:goal_expansion(A,B) */ if (cmod != USER_MODULE && /* we have tried this before */ (pe = RepPredProp( - Yap_GetPredPropByFunc(FunctorGoalExpansion2, USER_MODULE))) && + Yap_GetPredPropByFunc(FunctorGoalExpansion2, USER_MODULE))) && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL PASS_REGS, false)) { return complete_ge(true, omod, sl, creeping); @@ -1165,7 +1165,7 @@ static Int do_term_expansion(USES_REGS1) { ARG1 = g; if ((pe = RepPredProp( - Yap_GetPredPropByFunc(FunctorTermExpansion, USER_MODULE))) && + Yap_GetPredPropByFunc(FunctorTermExpansion, USER_MODULE))) && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL, false PASS_REGS)) { return complete_ge(true, omod, sl, creeping); @@ -1184,7 +1184,7 @@ static Int do_term_expansion(USES_REGS1) { ARG1 = Yap_MkApplTerm(FunctorModule, 2, mg_args); ARG2 = Yap_GetFromSlot(h2); if ((pe = RepPredProp( - Yap_GetPredPropByFunc(FunctorTermExpansion, SYSTEM_MODULE))) && + Yap_GetPredPropByFunc(FunctorTermExpansion, SYSTEM_MODULE))) && pe->OpcodeOfPred != FAIL_OPCODE && pe->OpcodeOfPred != UNDEF_OPCODE && Yap_execute_pred(pe, NULL, false PASS_REGS)) { return complete_ge(true, omod, sl, creeping); @@ -1202,7 +1202,7 @@ static Int execute0(USES_REGS1) { /* '$execute0'(Goal,Mod) */ return EnterCreepMode(t, mod PASS_REGS); } t = Yap_YapStripModule(t, &mod); -restart_exec: + restart_exec: if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, ARG3, "call/1"); return false; @@ -1421,7 +1421,10 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { int lval, out; Int OldBorder = LOCAL_CBorder; LOCAL_CBorder = LCL0 - (CELL *)B; - if (top && (lval = sigsetjmp(LOCAL_RestartEnv, 1)) != 0) { + sigjmp_buf signew, *sighold = LOCAL_RestartEnv; + LOCAL_RestartEnv = &signew; + + if (top && (lval = sigsetjmp(signew, 1)) != 0) { switch (lval) { case 1: { /* restart */ /* otherwise, SetDBForThrow will fail entering critical mode */ @@ -1441,30 +1444,35 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { LOCAL_PrologMode = UserMode; P = (yamop *)FAILCODE; } break; - case 2: { - /* arithmetic exception */ - /* must be done here, otherwise siglongjmp will clobber all the - * registers - */ - Yap_Error(LOCAL_Error_TYPE, TermNil, NULL); - /* reset the registers so that we don't have trash in abstract - * machine */ - Yap_set_fpu_exceptions( - getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG)); - P = (yamop *)FAILCODE; - LOCAL_PrologMode = UserMode; - } break; - case 4: { - P = (yamop *)FAILCODE; - LOCAL_PrologMode = UserMode; - } break; + case 2: { + /* arithmetic exception */ + /* must be done here, otherwise siglongjmp will clobber all the + * registers + */ + /* reset the registers so that we don't have trash in abstract + * machine */ + Yap_set_fpu_exceptions( + getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG)); + P = (yamop *)FAILCODE; + LOCAL_PrologMode = UserMode; + } break; case 3: { /* saved state */ LOCAL_CBorder = OldBorder; + LOCAL_RestartEnv = sighold; return false; } - default: - /* do nothing */ + case 4: { + /* abort */ + /* can be called from anywgerre, must reset registers, + */ + LOCAL_RestartEnv = sighold; + Yap_JumpToEnv(TermDAbort); + P = (yamop *)FAILCODE; LOCAL_PrologMode = UserMode; + } break; + default: + /* do nothing */ + LOCAL_PrologMode = UserMode; } } else { LOCAL_PrologMode = UserMode; @@ -1477,6 +1485,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) { if (!Yap_has_a_signal()) CalculateStackGap(PASS_REGS1); LOCAL_CBorder = OldBorder; + LOCAL_RestartEnv = sighold; return out; } @@ -1527,13 +1536,13 @@ void Yap_PrepGoal(arity_t arity, CELL *pt, choiceptr saved_b USES_REGS) { static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) { choiceptr saved_b = B; bool out; - + Yap_PrepGoal(arity, pt, saved_b PASS_REGS); CACHE_A1(); P = (yamop *)CodeAdr; // S = CellPtr(RepPredProp( // PredPropByFunc(Yap_MkFunctor(AtomCall, 1), 0))); /* A1 mishaps */ - + out = exec_absmi(top, YAP_EXEC_ABSMI PASS_REGS); if (top) Yap_flush(); @@ -1547,7 +1556,7 @@ static bool do_goal(yamop *CodeAdr, int arity, CELL *pt, bool top USES_REGS) { bool Yap_exec_absmi(bool top, yap_reset_t has_reset) { CACHE_REGS - return exec_absmi(top, has_reset PASS_REGS); + return exec_absmi(top, has_reset PASS_REGS); } /** @@ -1557,7 +1566,7 @@ bool Yap_exec_absmi(bool top, yap_reset_t has_reset) { */ void Yap_fail_all(choiceptr bb USES_REGS) { yamop *saved_p, *saved_cp; - + saved_p = P; saved_cp = CP; /* prune away choicepoints */ @@ -1576,7 +1585,7 @@ void Yap_fail_all(choiceptr bb USES_REGS) { DEPTH = B->cp_depth; #endif /* DEPTH_LIMIT */ YENV = ENV = B->cp_env; -/* recover local stack */ + /* recover local stack */ #ifdef DEPTH_LIMIT DEPTH = ENV[E_DEPTH]; #endif @@ -1603,16 +1612,16 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { yamop *saved_p, *saved_cp; yamop *CodeAdr; bool out; - + saved_p = P; saved_cp = CP; LOCAL_PrologMode |= TopGoalMode; - + PELOCK(81, ppe); CodeAdr = ppe->CodeOfPred; UNLOCK(ppe->PELock); out = do_goal(CodeAdr, ppe->ArityOfPE, pt, false PASS_REGS); - + if (out) { choiceptr cut_B; /* we succeeded, let's prune */ @@ -1688,21 +1697,21 @@ bool Yap_execute_pred(PredEntry *ppe, CELL *pt, bool pass_ex USES_REGS) { bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) { CACHE_REGS - Prop pe; + Prop pe; PredEntry *ppe; CELL *pt; /* preserve the current restart environment */ /* visualc*/ /* just keep the difference because of possible garbage collections */ - + if (IsAtomTerm(t)) { Atom a = AtomOfTerm(t); pt = NULL; pe = PredPropByAtom(a, mod); } else if (IsApplTerm(t)) { Functor f = FunctorOfTerm(t); - + if (IsBlobFunctor(f)) { Yap_Error(TYPE_ERROR_CALLABLE, t, "call/1"); return false; @@ -1725,7 +1734,7 @@ bool Yap_execute_goal(Term t, int nargs, Term mod, bool pass_ex) { void Yap_trust_last(void) { CACHE_REGS - ASP = B->cp_env; + ASP = B->cp_env; CP = B->cp_cp; HR = B->cp_h; #ifdef DEPTH_LIMIT @@ -1743,7 +1752,7 @@ void Yap_trust_last(void) { Term Yap_RunTopGoal(Term t, bool handle_errors) { CACHE_REGS - yamop *CodeAdr; + yamop *CodeAdr; Prop pe; PredEntry *ppe; CELL *pt; @@ -1751,7 +1760,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { Term tmod = CurrentModule; Term goal_out = 0; LOCAL_PrologMode |= TopGoalMode; - + t = Yap_YapStripModule(t, &tmod); if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, t, "call/1"); @@ -1764,7 +1773,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { arity = 0; } else if (IsApplTerm(t)) { Functor f = FunctorOfTerm(t); - + if (IsBlobFunctor(f)) { Yap_Error(TYPE_ERROR_CALLABLE, t, "call/1"); LOCAL_PrologMode &= ~TopGoalMode; @@ -1796,7 +1805,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { ts[0] = tmod; ts[1] = t; Functor f = Yap_MkFunctor(Yap_LookupAtom("call"), 1); - + pt = &t; t = Yap_MkApplTerm(FunctorModule, 2, ts); pe = Yap_GetPredPropByFunc(f, tmod); @@ -1806,7 +1815,7 @@ Term Yap_RunTopGoal(Term t, bool handle_errors) { PELOCK(82, ppe); CodeAdr = ppe->CodeOfPred; UNLOCK(ppe->PELock); - + #if !USE_SYSTEM_MALLOC if (LOCAL_TrailTop - HeapTop < 2048) { Yap_Error(RESOURCE_ERROR_TRAIL, TermNil, @@ -1822,7 +1831,7 @@ static void do_restore_regs(Term t, int restore_all USES_REGS) { Int i; Int max = ArityOfFunctor(FunctorOfTerm(t)) - 4; CELL *ptr = RepAppl(t) + 5; - + P = (yamop *)IntegerOfTerm(ptr[-4]); CP = (yamop *)IntegerOfTerm(ptr[-3]); ENV = (CELL *)(LCL0 - IntegerOfTerm(ptr[-2])); @@ -1852,11 +1861,11 @@ static Int restore_regs(USES_REGS1) { * a * call */ static Int restore_regs2(USES_REGS1) { - + Term t = Deref(ARG1), d0; choiceptr pt0; Int d; - + if (IsVarTerm(t)) { Yap_Error(INSTANTIATION_ERROR, t, "support for coroutining"); return (FALSE); @@ -1966,7 +1975,7 @@ static Int cut_up_to_next_disjunction(USES_REGS1) { bool Yap_Reset(yap_reset_t mode) { CACHE_REGS - int res = TRUE; + int res = TRUE; Yap_ResetException(worker_id); /* first, backtrack to the root */ @@ -2015,14 +2024,17 @@ static Int JumpToEnv() { /* find the first choicepoint that may be a catch */ // DBTerm *dbt = Yap_RefToException(); while (handler && Yap_PredForChoicePt(handler, NULL) != PredDollarCatch) { + //printf("--handler=%p, max=%p\n", handler, LCL0-LOCAL_CBorder); while (POP_CHOICE_POINT(handler)) { POP_FAIL_EXECUTE(handler); } + if (handler == (choiceptr)(LCL0-LOCAL_CBorder)) { + break; + } /* we are already doing a catch */ /* make sure we prune C-choicepoints */ - if (handler->cp_ap == NOCODE && - (handler >= (choiceptr)(LCL0 - LOCAL_CBorder) || - handler->cp_b == NULL)) { + if ((handler->cp_ap == NOCODE && handler->cp_b == NULL) || + (handler->cp_b >= (choiceptr)(LCL0 - LOCAL_CBorder))) { break; } handler = handler->cp_b; @@ -2062,7 +2074,7 @@ static Int JumpToEnv() { bool Yap_JumpToEnv(Term t) { CACHE_REGS - LOCAL_BallTerm = Yap_StoreTermInDB(t, 0); + LOCAL_BallTerm = Yap_StoreTermInDB(t, 0); if (!LOCAL_BallTerm) return false; if (LOCAL_PrologMode & TopGoalMode) @@ -2077,19 +2089,20 @@ static Int jump_env(USES_REGS1) { Yap_Error(INSTANTIATION_ERROR, t, "throw ball must be bound"); return false; } else if (IsApplTerm(t) && FunctorOfTerm(t) == FunctorError) { - Term t2, te; - + Term t2; + Yap_find_prolog_culprit(PASS_REGS1); - te = ArgOfTerm(1, t); - if (IsApplTerm(te) && IsAtomTerm((t2 = ArgOfTerm(1, te)))) { + // LOCAL_Error_TYPE = ERROR_EVENT; + t = ArgOfTerm(1, t); + if (IsApplTerm(t) && IsAtomTerm((t2 = ArgOfTerm(1, t)))) { LOCAL_ActiveError->errorAsText = AtomOfTerm(t2); - LOCAL_ActiveError->classAsText = NameOfFunctor(FunctorOfTerm(te)); - } else if (IsAtomTerm(te)) { - LOCAL_ActiveError->errorAsText = AtomOfTerm(te); + LOCAL_ActiveError->classAsText = NameOfFunctor(FunctorOfTerm(t)); + } else if (IsAtomTerm(t)) { + LOCAL_ActiveError->errorAsText = AtomOfTerm(t); LOCAL_ActiveError->classAsText = NULL; } } else { - LOCAL_Error_TYPE = THROW_EVENT; + // LOCAL_Error_TYPE = THROW_EVENT; } LOCAL_ActiveError->prologPredName = NULL; Yap_PutException(t); @@ -2111,27 +2124,27 @@ static Int generate_pred_info(USES_REGS1) { void Yap_InitYaamRegs(int myworker_id) { Term h0var; -// getchar(); + // getchar(); #if PUSH_REGS -/* Guarantee that after a longjmp we go back to the original abstract - machine registers */ + /* Guarantee that after a longjmp we go back to the original abstract + machine registers */ #ifdef THREADS if (myworker_id) { REGSTORE *rs = REMOTE_ThreadHandle(myworker_id).default_yaam_regs; pthread_setspecific(Yap_yaamregs_key, (const void *)rs); REMOTE_ThreadHandle(myworker_id).current_yaam_regs = rs; } -/* may be run by worker_id on behalf on myworker_id */ + /* may be run by worker_id on behalf on myworker_id */ #else Yap_regp = &Yap_standard_regs; #endif #endif /* PUSH_REGS */ CACHE_REGS - Yap_ResetException(worker_id); + Yap_ResetException(worker_id); Yap_PutValue(AtomBreak, MkIntTerm(0)); TR = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); HR = H0 = ((CELL *)REMOTE_GlobalBase(myworker_id)) + - 1; // +1: hack to ensure the gc does not try to mark mistakenly + 1; // +1: hack to ensure the gc does not try to mark mistakenly LCL0 = ASP = (CELL *)REMOTE_LocalBase(myworker_id); CurrentTrailTop = (tr_fr_ptr)(REMOTE_TrailTop(myworker_id) - MinTrailGap); /* notice that an initial choice-point and environment @@ -2155,12 +2168,12 @@ void Yap_InitYaamRegs(int myworker_id) { #ifdef YAPOR_SBA BSEG = #endif /* YAPOR_SBA */ - BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); + BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); #endif /* FROZEN_STACKS */ CalculateStackGap(PASS_REGS1); -/* the first real choice-point will also have AP=FAIL */ -/* always have an empty slots for people to use */ + /* the first real choice-point will also have AP=FAIL */ + /* always have an empty slots for people to use */ #if defined(YAPOR) || defined(THREADS) LOCAL = REMOTE(myworker_id); worker_id = myworker_id; @@ -2175,7 +2188,7 @@ void Yap_InitYaamRegs(int myworker_id) { REMOTE_GcGeneration(myworker_id) = Yap_NewTimedVar(h0var); REMOTE_GcCurrentPhase(myworker_id) = 0L; REMOTE_GcPhase(myworker_id) = - Yap_NewTimedVar(MkIntTerm(REMOTE_GcCurrentPhase(myworker_id))); + Yap_NewTimedVar(MkIntTerm(REMOTE_GcCurrentPhase(myworker_id))); #if defined(YAPOR) || defined(THREADS) PP = NULL; PREG_ADDR = NULL; @@ -2188,7 +2201,7 @@ void Yap_InitYaamRegs(int myworker_id) { #ifdef YAPOR_SBA BSEG = #endif /* YAPOR_SBA */ - BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); + BBREG = B_FZ = (choiceptr)REMOTE_LocalBase(myworker_id); TR = TR_FZ = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); #endif /* FROZEN_STACKS */ CalculateStackGap(PASS_REGS1); @@ -2201,7 +2214,7 @@ void Yap_InitYaamRegs(int myworker_id) { Term Yap_GetException(void) { CACHE_REGS - Term t = 0; + Term t = 0; if (LOCAL_BallTerm) { t = Yap_PopTermFromDB(LOCAL_BallTerm); @@ -2220,8 +2233,8 @@ bool Yap_RaiseException(void) { bool Yap_PutException(Term t) { CACHE_REGS - if ((LOCAL_BallTerm = Yap_StoreTermInDB(t, 0)) != NULL) - return true; + if ((LOCAL_BallTerm = Yap_StoreTermInDB(t, 0)) != NULL) + return true; return false; } @@ -2231,7 +2244,6 @@ bool Yap_ResetException(int wid) { Yap_PopTermFromDB(REMOTE_ActiveError(wid)->errorTerm); } REMOTE_ActiveError(wid)->errorTerm = NULL; - REMOTE_ActiveError(wid)->errorTerm = NULL; return true; } @@ -2270,7 +2282,7 @@ int Yap_dogc(int extra_args, Term *tp USES_REGS) { void Yap_InitExecFs(void) { CACHE_REGS - Term cm = CurrentModule; + Term cm = CurrentModule; Yap_InitComma(); Yap_InitCPred("$execute", 1, execute, 0); Yap_InitCPred("$execute", 2, execute2, 0); diff --git a/C/exo.c b/C/exo.c index 9bbe6ad82..eb4354ee7 100755 --- a/C/exo.c +++ b/C/exo.c @@ -21,7 +21,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #ifdef YAPOR #include "or.macros.h" diff --git a/C/exo_udi.c b/C/exo_udi.c index 741277e45..90a9cf382 100755 --- a/C/exo_udi.c +++ b/C/exo_udi.c @@ -20,7 +20,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #include "attvar.h" #ifdef YAPOR diff --git a/C/flags.c b/C/flags.c index bf04be85c..411026375 100644 --- a/C/flags.c +++ b/C/flags.c @@ -51,16 +51,16 @@ static Term stream(Term inp); static bool getenc(Term inp); static bool typein(Term inp); static bool dqf(Term t2); -static bool set_error_stream( Term inp ); -static bool set_input_stream( Term inp ); -static bool set_output_stream( Term inp ); +static bool set_error_stream(Term inp); +static bool set_input_stream(Term inp); +static bool set_output_stream(Term inp); static void newFlag(Term fl, Term val); static Int current_prolog_flag(USES_REGS1); static Int set_prolog_flag(USES_REGS1); #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) \ @@ -173,41 +173,38 @@ static Term isaccess(Term inp) { } static Term stream(Term inp) { - if ( IsVarTerm(inp) ) + if (IsVarTerm(inp)) return inp; - if (Yap_CheckStream( inp, Input_Stream_f | Output_Stream_f | - Append_Stream_f | Socket_Stream_f, "yap_flag/3" ) >= 0) + if (Yap_CheckStream(inp, Input_Stream_f | Output_Stream_f | Append_Stream_f | + Socket_Stream_f, + "yap_flag/3") >= 0) return inp; return 0; - } -static bool -set_error_stream( Term inp ) { - if( IsVarTerm(inp) ) - return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_error_stream ) ); - LOCAL_c_error_stream = Yap_CheckStream( inp, Output_Stream_f | - Append_Stream_f | Socket_Stream_f, "yap_flag/3" ); - return true; -} - -static bool -set_input_stream( Term inp ) { - if( IsVarTerm(inp) ) - return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_input_stream ) ); - LOCAL_c_input_stream = Yap_CheckStream( inp, Input_Stream_f | Socket_Stream_f, "yap_flag/3" ); +static bool set_error_stream(Term inp) { + if (IsVarTerm(inp)) + return Yap_unify(inp, Yap_StreamUserName(LOCAL_c_error_stream)); + LOCAL_c_error_stream = Yap_CheckStream( + inp, Output_Stream_f | Append_Stream_f | Socket_Stream_f, "yap_flag/3"); return true; } -static bool -set_output_stream( Term inp ) { - if( IsVarTerm(inp) ) - return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_output_stream ) ); - LOCAL_c_output_stream = Yap_CheckStream( inp, Output_Stream_f | - Append_Stream_f | Socket_Stream_f, "yap_flag/3" ); +static bool set_input_stream(Term inp) { + if (IsVarTerm(inp)) + return Yap_unify(inp, Yap_StreamUserName(LOCAL_c_input_stream)); + LOCAL_c_input_stream = + Yap_CheckStream(inp, Input_Stream_f | Socket_Stream_f, "yap_flag/3"); return true; } +static bool set_output_stream(Term inp) { + if (IsVarTerm(inp)) + return Yap_unify(inp, Yap_StreamUserName(LOCAL_c_output_stream)); + LOCAL_c_output_stream = Yap_CheckStream( + inp, Output_Stream_f | Append_Stream_f | Socket_Stream_f, "yap_flag/3"); + return true; +} static Term isground(Term inp) { return Yap_IsGroundTerm(inp) ? inp : TermZERO; @@ -669,12 +666,19 @@ static bool setYapFlagInModule(Term tflag, Term t2, Term mod) { flag_term *tarr = GLOBAL_Flags; if (!(fv->type(t2))) return false; + if (fv->helper && !(fv->helper(t2))) return false; Term tout = tarr[fv->FlagOfVE].at; - if (IsVarTerm(tout)) - Yap_PopTermFromDB(tarr[fv->FlagOfVE].DBT); - if (IsAtomOrIntTerm(t2)) + if (IsVarTerm(tout)) { + Term t; + while ((t = Yap_PopTermFromDB(tarr[fv->FlagOfVE].DBT)) == 0) { + if (!Yap_gc(2, ENV, gc_P(P, CP))) { + Yap_Error(RESOURCE_ERROR_STACK, TermNil, LOCAL_ErrorMessage); + return false; + } + } + } else if (IsAtomOrIntTerm(t2)) tarr[fv->FlagOfVE].at = t2; else { tarr[fv->FlagOfVE].DBT = Yap_StoreTermInDB(t2, 2); @@ -1182,24 +1186,26 @@ static Int source_mode(USES_REGS1) { static bool setInitialValue(bool bootstrap, flag_func f, const char *s, flag_term *tarr) { errno = 0; + const char *ss = (const char *)s; if (f == booleanFlag) { if (!bootstrap) { return 0; } - if (!strcmp(s, "true")) { + const char *ss = (const char *)s; + if (!strcmp(ss, "true")) { tarr->at = TermTrue; return true; } - if (!strcmp(s, "false")) { + if (!strcmp(ss, "false")) { tarr->at = TermFalse; return true; } - if (!strcmp(s, "on")) { + if (!strcmp(ss, "on")) { tarr->at = TermTrue; return true; } - if (!strcmp(s, "off")) { + if (!strcmp(ss, "off")) { tarr->at = TermFalse; return true; } @@ -1210,7 +1216,7 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s, if (!bootstrap) { return 0; } - UInt r = strtoul(s, NULL, 10); + UInt r = strtoul(ss, NULL, 10); Term t; if (errno) { Yap_Error(DOMAIN_ERROR_OUT_OF_RANGE, TermNil, @@ -1229,27 +1235,27 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s, if (!bootstrap) { return false; } - if (!strcmp(s, "INT_MAX")) { + if (!strcmp(ss, "INT_MAX")) { tarr->at = MkIntTerm(Int_MAX); return true; } - if (!strcmp(s, "MAX_THREADS")) { + if (!strcmp(ss, "MAX_THREADS")) { tarr->at = MkIntTerm(MAX_THREADS); return true; } - if (!strcmp(s, "MAX_WORKERS")) { + if (!strcmp(ss, "MAX_WORKERS")) { tarr->at = MkIntTerm(MAX_WORKERS); return true; } - if (!strcmp(s, "INT_MIN")) { + if (!strcmp(ss, "INT_MIN")) { tarr->at = MkIntTerm(Int_MIN); return true; } - if (!strcmp(s, "YAP_NUMERIC_VERSION")) { + if (!strcmp(ss, "YAP_NUMERIC_VERSION")) { tarr->at = MkIntTerm(atol(YAP_NUMERIC_VERSION)); return true; } - if (!strcmp(s, "YAP_NUMERIC_VERSION")) { + if (!strcmp(ss, "YAP_NUMERIC_VERSION")) { tarr->at = MkIntTerm(atol(YAP_NUMERIC_VERSION)); return true; } @@ -1297,7 +1303,7 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s, return true; } } - } else if (strcmp(s, "@boot") == 0) { + } else if (strcmp(ss, "@boot") == 0) { if (bootstrap) { return true; } @@ -1317,9 +1323,9 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s, return false; } CACHE_REGS - encoding_t encoding = ENC_ISO_UTF8; - t0 = - Yap_StringToTerm(s, strlen(s) + 1, &encoding, GLOBAL_MaxPriority, 0L); + const unsigned char *us = (const unsigned char *)s; + t0 = Yap_BufferToTermWithPrioBindings(us, strlen(s) + 1, TermNil, + GLOBAL_MaxPriority, 0L); if (!t0) return false; if (IsAtomTerm(t0) || IsIntTerm(t0)) { @@ -1570,7 +1576,7 @@ static Int do_create_prolog_flag(USES_REGS1) { fv->type = isground; } break; case PROLOG_FLAG_PROPERTY_SCOPE: - free(args); + free(args); return false; case PROLOG_FLAG_PROPERTY_END: break; @@ -1621,8 +1627,9 @@ void Yap_InitFlags(bool bootstrap) { while (f->name != NULL) { bool itf = setInitialValue(bootstrap, f->def, f->init, LOCAL_Flags + LOCAL_flagCount); - // Term itf = Yap_StringToTerm(f->init, strlen(f->init)+1, - // EBC_ISO_UTF8, GLOBAL_MaxPriority, &tp); + // Term itf = Yap_BufferToTermWithPrioBindings(f->init, + // strlen(f->init)+1, + // LOBAL_MaxPriority, &tp); if (itf) { initFlag(f, LOCAL_flagCount, false); } diff --git a/C/globals.c b/C/globals.c index 9897a3221..2826fa41c 100644 --- a/C/globals.c +++ b/C/globals.c @@ -115,7 +115,7 @@ threads that are created after the registration. #include "YapHeap.h" #include "yapio.h" #include "iopreds.h" -#include "eval.h" +#include "YapEval.h" #include "attvar.h" #include diff --git a/C/gmp_support.c b/C/gmp_support.c index 167802cb1..a1f7e506f 100644 --- a/C/gmp_support.c +++ b/C/gmp_support.c @@ -18,7 +18,7 @@ #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_STRING_H #include #endif diff --git a/C/grow.c b/C/grow.c index 13e30ad11..cbd532665 100755 --- a/C/grow.c +++ b/C/grow.c @@ -20,7 +20,7 @@ #include "yapio.h" #include "alloc.h" #include "sshift.h" -#include "compile.h" +#include "YapCompile.h" #include "attvar.h" #include "cut_c.h" #if HAVE_STRING_H diff --git a/C/heapgc.c b/C/heapgc.c index 8cec0ac7f..68415abbe 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -134,7 +134,7 @@ gc_growtrail(int committed, tr_fr_ptr begsTR, cont *old_cont_top0 USES_REGS) #endif /* could not find more trail */ save_machine_regs(); - siglongjmp(LOCAL_gc_restore, 2); + siglongjmp(*LOCAL_gc_restore, 2); } } @@ -397,7 +397,7 @@ check_pr_trail( tr_fr_ptr rc USES_REGS) if (!Yap_locked_growtrail(0, TRUE) || TRUE) { /* could not find more trail */ save_machine_regs(); - siglongjmp(LOCAL_gc_restore, 2); + siglongjmp(*LOCAL_gc_restore, 2); } rc = TR-n; } @@ -525,7 +525,7 @@ pop_registers(Int num_regs, yamop *nextop USES_REGS) /* error: we don't have enough room */ /* could not find more trail */ save_machine_regs(); - siglongjmp(LOCAL_gc_restore, 4); + siglongjmp(*LOCAL_gc_restore, 4); } } } @@ -1450,7 +1450,7 @@ mark_variable(CELL_PTR current USES_REGS) /* error: we don't have enough room */ /* could not find more trail */ save_machine_regs(); - siglongjmp(LOCAL_gc_restore, 3); + siglongjmp(*LOCAL_gc_restore, 3); } else if (n > 0) { CELL *ptr = LOCAL_extra_gc_cells; @@ -3934,6 +3934,9 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS) UInt gc_phase; UInt alloc_sz; int jmp_res; + sigjmp_buf jmp; + + LOCAL_gc_restore = &jmp; heap_cells = HR-H0; gc_verbose = is_gc_verbose(); @@ -3989,7 +3992,7 @@ do_gc(Int predarity, CELL *current_env, yamop *nextop USES_REGS) } #endif time_start = Yap_cputime(); - jmp_res = sigsetjmp(LOCAL_gc_restore, 0); + jmp_res = sigsetjmp(jmp, 0); if (jmp_res == 2) { UInt sz; diff --git a/C/index.c b/C/index.c index 7722ab2f3..6fd571344 100755 --- a/C/index.c +++ b/C/index.c @@ -634,7 +634,7 @@ type_of_verb(rest,passive). */ #include "absmi.h" -#include "compile.h" +#include "YapCompile.h" #if DEBUG #include "yapio.h" #endif diff --git a/C/load_dll.c b/C/load_dll.c index ea881df06..e0889edc5 100755 --- a/C/load_dll.c +++ b/C/load_dll.c @@ -42,15 +42,15 @@ Yap_FindExecutable(void) void * Yap_LoadForeignFile(char *file, int flags) { - void *ptr= (void *)LoadLibrary(file); + char *buf = malloc(1024); + printf("file=%s\n" , file ); + void *ptr= (void *)LoadLibrary(file); if (!ptr) { - CACHE_REGS - LOCAL_ErrorMessage = NULL; FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), LOCAL_ErrorMessage, 256, + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023, NULL); - } + } return ptr; } @@ -83,17 +83,18 @@ LoadForeign(StringList ofiles, StringList libs, HINSTANCE handle; const char *file = AtomName(ofiles->name); - if (!Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) && + if (Yap_findFile(file, NULL, NULL, LOCAL_FileNameBuf, true, YAP_OBJ, true, true) && (handle=LoadLibrary(LOCAL_FileNameBuf)) != 0) { LOCAL_ErrorMessage = NULL; if (*init_proc == NULL) *init_proc = (YapInitProc)GetProcAddress((HMODULE)handle, proc_name); } else { - FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), LOCAL_ErrorMessage, 256, - NULL); + char *buf = malloc(1024); + FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 1023, + NULL); //fprintf(stderr,"WinError: %s\n", LOCAL_ErrorSay); } ofiles = ofiles->next; diff --git a/C/load_foreign.c b/C/load_foreign.c index a1dd5fea7..aeb2c9351 100644 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -46,7 +46,7 @@ p_load_foreign( USES_REGS1 ) YapInitProc InitProc = NULL; Term t, t1; StringList new; - Int returncode = FALSE; + bool returncode = FALSE; yhandle_t CurSlot = Yap_StartSlots(); // Yap_DebugPlWrite(ARG1); printf("%s\n", " \n"); @@ -80,13 +80,17 @@ p_load_foreign( USES_REGS1 ) /* get the initialization function name */ t1 = Deref(ARG3); InitProcName = (char *)RepAtom(AtomOfTerm(t1))->StrOfAE; - + + // verify if it was waiting for initialization + if (Yap_LateInit( InitProcName ) ){ + returncode = true; + } else /* call the OS specific function for dynamic loading */ if(Yap_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) { Yap_StartSlots( ); (*InitProc)(); Yap_CloseSlots(CurSlot); - returncode = TRUE; + returncode = true; } /* I should recover space if load foreign fails */ diff --git a/C/mavar.c b/C/mavar.c index 3ce613ba8..135fff36e 100644 --- a/C/mavar.c +++ b/C/mavar.c @@ -48,7 +48,7 @@ deterministic computations. #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Int p_setarg( USES_REGS1 ); static Int p_create_mutable( USES_REGS1 ); diff --git a/C/parser.c b/C/parser.c index e4001d273..6296a4ced 100755 --- a/C/parser.c +++ b/C/parser.c @@ -141,7 +141,7 @@ dot with single quotes. #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" /* stuff we want to use in standard YAP code */ #include "iopreds.h" @@ -302,7 +302,7 @@ static Term VarNames(VarEntry *p, Term l USES_REGS) { VarNames(p->VarLeft, l PASS_REGS) PASS_REGS)); if (HR > ASP - 4096) { save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); + longjmp(*LOCAL_IOBotch, 1); } return (o); } else { @@ -332,7 +332,7 @@ static Term Singletons(VarEntry *p, Term l USES_REGS) { Singletons(p->VarLeft, l PASS_REGS) PASS_REGS)); if (HR > ASP - 4096) { save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); + longjmp(*LOCAL_IOBotch, 1); } return (o); } else { @@ -357,7 +357,7 @@ static Term Variables(VarEntry *p, Term l USES_REGS) { Variables(p->VarRight, Variables(p->VarLeft, l PASS_REGS) PASS_REGS)); if (HR > ASP - 4096) { save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); + siglongjmp(*LOCAL_IOBotch, 1); } return (o); } else { diff --git a/C/pold.c b/C/pold.c deleted file mode 100755 index 82c35294e..000000000 --- a/C/pold.c +++ /dev/null @@ -1,1047 +0,0 @@ -/************************************************************************* -* * -* YAP Prolog * -* * -* Yap Prolog was developed at NCCUP - Universidade do Porto * -* * -* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * -* * -************************************************************************** -* * -* File: parser.c * -* Last rev: * -* mods: * -* comments: Prolog's parser * -* * -*************************************************************************/ -#ifdef SCCS -static char SccsId[] = "%W% %G%"; -#endif - -/** - -@defgroup YAPSyntax YAP Syntax -@ingroup YAPProgramming -@{ - -We will describe the syntax of YAP at two levels. We first will -describe the syntax for Prolog terms. In a second level we describe -the \a tokens from which Prolog \a terms are -built. - -@defgroup Formal_Syntax Syntax of Terms -@ingroup Syntax -@{ - -Below, we describe the syntax of YAP terms from the different -classes of tokens defined above. The formalism used will be BNF, -extended where necessary with attributes denoting integer precedence or -operator type. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - term -----> subterm(1200) end_of_term_marker - - subterm(N) ----> term(M) [M <= N] - - term(N) ----> op(N, fx) subterm(N-1) - | op(N, fy) subterm(N) - | subterm(N-1) op(N, xfx) subterm(N-1) - | subterm(N-1) op(N, xfy) subterm(N) - | subterm(N) op(N, yfx) subterm(N-1) - | subterm(N-1) op(N, xf) - | subterm(N) op(N, yf) - - term(0) ----> atom '(' arguments ')' - | '(' subterm(1200) ')' - | '{' subterm(1200) '}' - | list - | string - | number - | atom - | variable - - arguments ----> subterm(999) - | subterm(999) ',' arguments - - list ----> '[]' - | '[' list_expr ']' - - list_expr ----> subterm(999) - | subterm(999) list_tail - - list_tail ----> ',' list_expr - | ',..' subterm(999) - | '|' subterm(999) -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Notes: - - + \a op(N,T) denotes an atom which has been previously declared with type - \a T and base precedence \a N. - - + Since ',' is itself a pre-declared operator with type \a xfy and - precedence 1000, is \a subterm starts with a '(', \a op must be - followed by a space to avoid ambiguity with the case of a functor - followed by arguments, e.g.: - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -+ (a,b) [the same as '+'(','(a,b)) of arity one] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - versus - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -+(a,b) [the same as '+'(a,b) of arity two] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - + -In the first rule for term(0) no blank space should exist between -\a atom and '('. - - + -Each term to be read by the YAP parser must end with a single -dot, followed by a blank (in the sense mentioned in the previous -paragraph). When a name consisting of a single dot could be taken for -the end of term marker, the ambiguity should be avoided by surrounding the -dot with single quotes. - -@} - -*/ - -/* - * Description: - * - * parser: produces a prolog term from an array of tokens - * - * parser usage: the parser takes its input from an array of token descriptions - * addressed by the global variable 'tokptr' and produces a Term as result. A - * macro 'NextToken' should be defined in 'yap.h' for advancing 'tokptr' from - * one token to the next. In the distributed version this macro also updates - * a variable named 'toktide' for keeping track of how far the parser went - * before failling with a syntax error. The parser should be invoked with - * 'tokptr' pointing to the first token. The last token should have type - * 'eot_tok'. The parser return either a Term. Syntactic errors are signaled - * by a return value 0. The parser builds new terms on the 'global stack' and - * also uses an auxiliary stack pointed to by 'AuxSp'. In the distributed - * version this auxiliary stack is assumed to grow downwards. This - * assumption, however, is only relevant to routine 'ParseArgs', and to the - * variable toktide. conclusion: set tokptr pointing to first token set AuxSp - * Call Parse - * - * VSC: Working whithout known bugs in 87/4/6 - * - * LD: -I or +I evaluated by parser 87/4/28 - * - * LD: parser extended 87/4/28 - * - */ - -#include "Yap.h" -#include "Yatom.h" -#include "YapHeap.h" -#include "YapText.h" -#include "yapio.h" -#include "eval.h" -/* stuff we want to use in standard YAP code */ -#include "iopreds.h" -#if HAVE_STRING_H -#include -#endif -#if HAVE_STDARG_H -#include -#endif - -#ifdef __STDC__XXX -#define Volatile volatile -#else -#define Volatile -#endif - -/* weak backtraking mechanism based on long_jump */ - -typedef struct jmp_buff_struct { sigjmp_buf JmpBuff; } JMPBUFF; - -static void GNextToken(CACHE_TYPE1); -static void checkfor(wchar_t, JMPBUFF *, encoding_t CACHE_TYPE); -static Term ParseArgs(Atom, wchar_t, JMPBUFF *, Term, encoding_t, Term CACHE_TYPE); -static Term ParseList(JMPBUFF *, encoding_t, Term CACHE_TYPE); -static Term ParseTerm(int, JMPBUFF *, encoding_t, Term CACHE_TYPE); - -const char *Yap_tokRep(TokEntry *tokptr, encoding_t enc); - -static void syntax_msg(const char *msg, ...) { - CACHE_REGS - va_list ap; - - if (LOCAL_toktide == LOCAL_tokptr) { - LOCAL_ErrorMessage = malloc(MAX_ERROR_MSG_SIZE+1); - va_start(ap, msg); - vsnprintf(LOCAL_ErrorMessage, YAP_FILENAME_MAX , msg, ap); - LOCAL_Error_TYPE = SYNTAX_ERROR; - va_end(ap); - } -} - -#define TRY(S, P) \ - { \ - Volatile JMPBUFF *saveenv, newenv; \ - Volatile TokEntry *saveT = LOCAL_tokptr; \ - Volatile CELL *saveH = HR; \ - Volatile int savecurprio = curprio; \ - saveenv = FailBuff; \ - if (!sigsetjmp(newenv.JmpBuff, 0)) { \ - FailBuff = &newenv; \ - S; \ - FailBuff = saveenv; \ - P; \ - } else { \ - FailBuff = saveenv; \ - HR = saveH; \ - curprio = savecurprio; \ - LOCAL_tokptr = saveT; \ - } \ - } - -#define TRY3(S, P, F) \ - { \ - Volatile JMPBUFF *saveenv, newenv; \ - Volatile TokEntry *saveT = LOCAL_tokptr; \ - Volatile CELL *saveH = HR; \ - saveenv = FailBuff; \ - if (!sigsetjmp(newenv.JmpBuff, 0)) { \ - FailBuff = &newenv; \ - S; \ - FailBuff = saveenv; \ - P; \ - } else { \ - FailBuff = saveenv; \ - HR = saveH; \ - LOCAL_tokptr = saveT; \ - F \ - } \ - } - -#define FAIL siglongjmp(FailBuff->JmpBuff, 1) - -VarEntry * -Yap_LookupVar(const char *var) /* lookup variable in variables table */ -{ - CACHE_REGS - VarEntry *p; - -#if DEBUG - if (GLOBAL_Option[4]) - fprintf(stderr, "[LookupVar %s]", var); -#endif - if (var[0] != '_' || var[1] != '\0') { - VarEntry **op = &LOCAL_VarTable; - UInt hv; - - p = LOCAL_VarTable; - hv = HashFunction((unsigned char *)var) % AtomHashTableSize; - while (p != NULL) { - CELL hpv = p->hv; - if (hv == hpv) { - Int scmp; - if ((scmp = strcmp(var, p->VarRep)) == 0) { - p->refs++; - return (p); - } else if (scmp < 0) { - op = &(p->VarLeft); - p = p->VarLeft; - } else { - op = &(p->VarRight); - p = p->VarRight; - } - } else if (hv < hpv) { - op = &(p->VarLeft); - p = p->VarLeft; - } else { - op = &(p->VarRight); - p = p->VarRight; - } - } - p = (VarEntry *)Yap_AllocScannerMemory(strlen(var) + sizeof(VarEntry)); - *op = p; - p->VarLeft = p->VarRight = NULL; - p->hv = hv; - p->refs = 1L; - strcpy(p->VarRep, var); - } else { - /* anon var */ - p = (VarEntry *)Yap_AllocScannerMemory(sizeof(VarEntry) + 2); - p->VarLeft = LOCAL_AnonVarTable; - LOCAL_AnonVarTable = p; - p->VarRight = NULL; - p->refs = 0L; - p->hv = 1L; - p->VarRep[0] = '_'; - p->VarRep[1] = '\0'; - } - p->VarAdr = TermNil; - return (p); -} - -static Term VarNames(VarEntry *p, Term l USES_REGS) { - if (p != NULL) { - if (strcmp(p->VarRep, "_") != 0) { - Term t[2]; - Term o; - - t[0] = MkAtomTerm(Yap_LookupAtom(p->VarRep)); - if (!IsVarTerm(p->VarAdr)) - p->VarAdr = MkVarTerm(); - t[1] = p->VarAdr; - o = Yap_MkApplTerm(FunctorEq, 2, t); - o = MkPairTerm(o, VarNames(p->VarRight, - VarNames(p->VarLeft, l PASS_REGS) PASS_REGS)); - if (HR > ASP - 4096) { - save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); - } - return (o); - } else { - return VarNames(p->VarRight, VarNames(p->VarLeft, l PASS_REGS) PASS_REGS); - } - } else { - return (l); - } -} - -Term Yap_VarNames(VarEntry *p, Term l) { - CACHE_REGS - return VarNames(p, l PASS_REGS); -} - -static Term Singletons(VarEntry *p, Term l USES_REGS) { - if (p != NULL) { - if (p->VarRep[0] != '_' && p->refs == 1) { - Term t[2]; - Term o; - - t[0] = MkAtomTerm(Yap_LookupAtom(p->VarRep)); - t[1] = p->VarAdr; - o = Yap_MkApplTerm(FunctorEq, 2, t); - o = MkPairTerm(o, - Singletons(p->VarRight, - Singletons(p->VarLeft, l PASS_REGS) PASS_REGS)); - if (HR > ASP - 4096) { - save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); - } - return (o); - } else { - return Singletons(p->VarRight, - Singletons(p->VarLeft, l PASS_REGS) PASS_REGS); - } - } else { - return (l); - } -} - -Term Yap_Singletons(VarEntry *p, Term l) { - CACHE_REGS - return Singletons(p, l PASS_REGS); -} - -static Term Variables(VarEntry *p, Term l USES_REGS) { - if (p != NULL) { - Term o; - o = MkPairTerm( - p->VarAdr, - Variables(p->VarRight, Variables(p->VarLeft, l PASS_REGS) PASS_REGS)); - if (HR > ASP - 4096) { - save_machine_regs(); - siglongjmp(LOCAL_IOBotch, 1); - } - return (o); - } else { - return (l); - } -} - -Term Yap_Variables(VarEntry *p, Term l) { - CACHE_REGS - return Variables(p, l PASS_REGS); -} - -static int IsPrefixOp(Atom op, int *pptr, int *rpptr, Term cmod USES_REGS) { - int p; - - OpEntry *opp = Yap_GetOpProp(op, PREFIX_OP, cmod PASS_REGS); - if (!opp) - return FALSE; - if (opp->OpModule && opp->OpModule != cmod) { - READ_UNLOCK(opp->OpRWLock); - return FALSE; - } - if ((p = opp->Prefix) != 0) { - READ_UNLOCK(opp->OpRWLock); - *pptr = *rpptr = p &MaskPrio; - if (p & DcrrpFlag) - --*rpptr; - return TRUE; - } else { - READ_UNLOCK(opp->OpRWLock); - return FALSE; - } -} - -int Yap_IsPrefixOp(Atom op, int *pptr, int *rpptr) { - CACHE_REGS - return IsPrefixOp(op, pptr, rpptr, CurrentModule PASS_REGS); -} - -static int IsInfixOp(Atom op, int *pptr, int *lpptr, int *rpptr, Term cmod USES_REGS) { - int p; - - OpEntry *opp = Yap_GetOpProp(op, INFIX_OP, cmod PASS_REGS); - if (!opp) - return FALSE; - if (opp->OpModule && opp->OpModule != cmod) { - READ_UNLOCK(opp->OpRWLock); - return FALSE; - } - if ((p = opp->Infix) != 0) { - READ_UNLOCK(opp->OpRWLock); - *pptr = *rpptr = *lpptr = p &MaskPrio; - if (p & DcrrpFlag) - --*rpptr; - if (p & DcrlpFlag) - --*lpptr; - return TRUE; - } else { - READ_UNLOCK(opp->OpRWLock); - return FALSE; - } -} - -int Yap_IsInfixOp(Atom op, int *pptr, int *lpptr, int *rpptr) { - CACHE_REGS - return IsInfixOp(op, pptr, lpptr, rpptr, CurrentModule PASS_REGS); -} - -static int IsPosfixOp(Atom op, int *pptr, int *lpptr, Term cmod USES_REGS) { - int p; - - OpEntry *opp = Yap_GetOpProp(op, POSFIX_OP, cmod PASS_REGS); - if (!opp) - return FALSE; - if (opp->OpModule && opp->OpModule != cmod) { - READ_UNLOCK(opp->OpRWLock); - return FALSE; - } - if ((p = opp->Posfix) != 0) { - READ_UNLOCK(opp->OpRWLock); - *pptr = *lpptr = p &MaskPrio; - if (p & DcrlpFlag) - --*lpptr; - return (TRUE); - } else { - READ_UNLOCK(opp->OpRWLock); - return (FALSE); - } -} - -int Yap_IsPosfixOp(Atom op, int *pptr, int *lpptr) { - CACHE_REGS - return IsPosfixOp(op, pptr, lpptr, CurrentModule PASS_REGS); -} - -inline static void GNextToken(USES_REGS1) { - if (LOCAL_tokptr->Tok == Ord(eot_tok)) - return; - if (LOCAL_tokptr == LOCAL_toktide) { - LOCAL_toktide = LOCAL_tokptr = LOCAL_tokptr->TokNext; - } else - LOCAL_tokptr = LOCAL_tokptr->TokNext; -} - -inline static void checkfor(wchar_t c, JMPBUFF *FailBuff, encoding_t enc USES_REGS) { - if (LOCAL_tokptr->Tok != Ord(Ponctuation_tok) || - LOCAL_tokptr->TokInfo != (Term)c) { - char s[1024]; - strncpy(s, Yap_tokRep(LOCAL_tokptr, enc), 1023); - syntax_msg("line %d: expected to find \'%c\', found %s", LOCAL_tokptr->TokPos, c, s); - FAIL; - } - NextToken; -} - -#ifdef O_QUASIQUOTATIONS - -static int is_quasi_quotation_syntax(Term goal, Atom *pat, encoding_t enc, Term cmod) { - CACHE_REGS - Term m = cmod, t; - Atom at; - UInt arity; - Functor f; - - t = Yap_StripModule(goal, &m); - f = FunctorOfTerm(t); - *pat = at = NameOfFunctor(f); - arity = ArityOfFunctor(f); - if (arity > 0) - return TRUE; - return FALSE; -} - -static int get_quasi_quotation(term_t t, unsigned char **here, - unsigned char *ein) { - unsigned char *in, *start = *here; - - for (in = start; in <= ein; in++) { - if (in[0] == '}' && in[-1] == '|') { - *here = in + 1; /* after } */ - in--; /* Before | */ - - if (LOCAL_quasi_quotations) /* option; must return strings */ - { - PL_chars_t txt; - int rc; - - txt.text.t = (char *)start; - txt.length = in - start; - txt.storage = PL_CHARS_HEAP; - txt.encoding = ENC_UTF8; - txt.canonical = FALSE; - - rc = PL_unify_text(t, 0, &txt, PL_CODE_LIST); - PL_free_text(&txt); - - return rc; - } else { - return PL_unify_term(t, PL_FUNCTOR, FUNCTOR_dquasi_quotation3, - PL_POINTER, LOCAL, PL_INTPTR, (intptr_t)(start), - PL_INTPTR, (intptr_t)(in - start)); - } - } - } - - return FALSE; // errorWarning("end_of_file_in_quasi_quotation", 0, _PL_rd); -} -#endif /*O_QUASIQUOTATIONS*/ - -static Term ParseArgs(Atom a, wchar_t close, JMPBUFF *FailBuff, - Term arg1, encoding_t enc, Term cmod USES_REGS) { - int nargs = 0; - Term *p, t; - Functor func; -#ifdef SFUNC - SFEntry *pe = (SFEntry *)Yap_GetAProp(a, SFProperty); -#endif - - NextToken; - p = (Term *)ParserAuxSp; - if (arg1) { - *p = arg1; - nargs++; - ParserAuxSp = (char *)(p + 1); - if (LOCAL_tokptr->Tok == Ord(Ponctuation_tok) && - LOCAL_tokptr->TokInfo == close) { - - func = Yap_MkFunctor(a, 1); - if (func == NULL) { - syntax_msg("line %d: Heap Overflow",LOCAL_tokptr->TokPos ); - FAIL; - } - t = Yap_MkApplTerm(func, nargs, p); - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos ); - return TermNil; - } - NextToken; - return t; - } - } - while (1) { - Term *tp = (Term *)ParserAuxSp; - if (ParserAuxSp + 1 > LOCAL_TrailTop) { - syntax_msg("line %d: Trail Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - *tp++ = Unsigned(ParseTerm(999, FailBuff, enc,cmod PASS_REGS)); - ParserAuxSp = (char *)tp; - ++nargs; - if (LOCAL_tokptr->Tok != Ord(Ponctuation_tok)) - break; - if (((int)LOCAL_tokptr->TokInfo) != ',') - break; - NextToken; - } - ParserAuxSp = (char *)p; - /* - * Needed because the arguments for the functor are placed in reverse - * order - */ - if (HR > ASP - (nargs + 1)) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - func = Yap_MkFunctor(a, nargs); - if (func == NULL) { - syntax_msg("line %d: Heap Overflow",LOCAL_tokptr->TokPos); - FAIL; - } -#ifdef SFUNC - if (pe) - t = MkSFTerm(Yap_MkFunctor(a, SFArity), nargs, p, pe->NilValue); - else - t = Yap_MkApplTerm(Yap_MkFunctor(a, nargs), nargs, p); -#else - if (a == AtomDBref && nargs == 2) - t = MkDBRefTerm((DBRef)IntegerOfTerm(p[0])); - else - t = Yap_MkApplTerm(func, nargs, p); -#endif - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - return TermNil; - } - /* check for possible overflow against local stack */ - checkfor(close, FailBuff, enc PASS_REGS); - return t; -} - -static Term MakeAccessor(Term t, Functor f USES_REGS) { - UInt arity = ArityOfFunctor(FunctorOfTerm(t)), i; - Term tf[2], tl = TermNil; - - tf[1] = ArgOfTerm(1, t); - for (i = arity; i > 1; i--) { - tl = MkPairTerm(ArgOfTerm(i, t), tl); - } - tf[0] = tl; - return Yap_MkApplTerm(f, 2, tf); -} - -static Term ParseList(JMPBUFF *FailBuff, encoding_t enc, Term cmod USES_REGS) { - Term o; - CELL *to_store; - o = AbsPair(HR); -loop: - to_store = HR; - HR += 2; - to_store[0] = ParseTerm(999, FailBuff, enc, cmod PASS_REGS); - if (LOCAL_tokptr->Tok == Ord(Ponctuation_tok)) { - if (((int)LOCAL_tokptr->TokInfo) == ',') { - NextToken; - { - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - to_store[1] = TermNil; - syntax_msg("line %d: Stack Overflow" ,LOCAL_tokptr->TokPos); - FAIL; - } else { - to_store[1] = AbsPair(HR); - goto loop; - } - } - } else if (((int)LOCAL_tokptr->TokInfo) == '|') { - NextToken; - to_store[1] = ParseTerm(999, FailBuff, enc, cmod PASS_REGS); - } else { - to_store[1] = MkAtomTerm(AtomNil); - } - } else { - syntax_msg("line %d: looking for symbol ',','|' got symbol '%s'",LOCAL_tokptr->TokPos, - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - return (o); -} - -static Term ParseTerm(int prio, JMPBUFF *FailBuff, encoding_t enc, Term cmod USES_REGS) { - /* parse term with priority prio */ - Volatile Term t; - Volatile Functor func; - Volatile VarEntry *varinfo; - Volatile int curprio = 0, opprio, oplprio, oprprio; - Volatile Atom opinfo; - - switch (LOCAL_tokptr->Tok) { - case Name_tok: - t = LOCAL_tokptr->TokInfo; - NextToken; - /* special rules apply for +1, -2.3, etc... */ - if (LOCAL_tokptr->Tok == Number_tok) { - if ((Atom)t == AtomMinus) { - t = LOCAL_tokptr->TokInfo; - if (IsIntTerm(t)) - t = MkIntTerm(-IntOfTerm(t)); - else if (IsFloatTerm(t)) - t = MkFloatTerm(-FloatOfTerm(t)); -#ifdef USE_GMP - else if (IsBigIntTerm(t)) { - t = Yap_gmp_neg_big(t); - } -#endif - else - t = MkLongIntTerm(-LongIntOfTerm(t)); - NextToken; - break; - } - } - if ((LOCAL_tokptr->Tok != Ord(Ponctuation_tok) || - Unsigned(LOCAL_tokptr->TokInfo) != 'l') && - IsPrefixOp((Atom)t, &opprio, &oprprio, cmod PASS_REGS)) { - if (LOCAL_tokptr->Tok == Name_tok) { - Atom at = (Atom)LOCAL_tokptr->TokInfo; -#ifndef _MSC_VER - if ((Atom)t == AtomPlus) { - if (at == AtomInf) { - t = MkFloatTerm(INFINITY); - NextToken; - break; - } else if (at == AtomNan) { - t = MkFloatTerm(NAN); - NextToken; - break; - } - } else if ((Atom)t == AtomMinus) { - if (at == AtomInf) { - t = MkFloatTerm(-INFINITY); - NextToken; - break; - } else if (at == AtomNan) { - t = MkFloatTerm(NAN); - NextToken; - break; - } - } -#endif - } - if (opprio <= prio) { - /* try to parse as a prefix operator */ - TRY( - /* build appl on the heap */ - func = Yap_MkFunctor((Atom)t, 1); if (func == NULL) { - syntax_msg("line %d: Heap Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - t = ParseTerm(oprprio, FailBuff, enc, cmod PASS_REGS); - t = Yap_MkApplTerm(func, 1, &t); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } curprio = opprio; - , break;) - } - } - if (LOCAL_tokptr->Tok == Ord(Ponctuation_tok) && - Unsigned(LOCAL_tokptr->TokInfo) == 'l') - t = ParseArgs((Atom)t, ')', FailBuff, 0L, enc, cmod PASS_REGS); - else - t = MkAtomTerm((Atom)t); - break; - - case Number_tok: - t = LOCAL_tokptr->TokInfo; - NextToken; - break; - - case String_tok: /* build list on the heap */ - t = LOCAL_tokptr->TokInfo; - NextToken; - break; - - case Var_tok: - varinfo = (VarEntry *)(LOCAL_tokptr->TokInfo); - if ((t = varinfo->VarAdr) == TermNil) { - t = varinfo->VarAdr = MkVarTerm(); - } - NextToken; - break; - - case Error_tok: - syntax_msg("line %d: found ill-formed \"%s\"",LOCAL_tokptr->TokPos, Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - - case Ponctuation_tok: - - switch ((int)LOCAL_tokptr->TokInfo) { - case '(': - case 'l': /* non solo ( */ - NextToken; - t = ParseTerm(GLOBAL_MaxPriority, FailBuff, enc, cmod PASS_REGS); - checkfor(')', FailBuff, enc PASS_REGS); - break; - case '[': - NextToken; - if (LOCAL_tokptr->Tok == Ponctuation_tok && - (int)LOCAL_tokptr->TokInfo == ']') { - t = TermNil; - NextToken; - break; - } - t = ParseList(FailBuff, enc, cmod PASS_REGS); - checkfor(']', FailBuff, enc PASS_REGS); - break; - case '{': - NextToken; - if (LOCAL_tokptr->Tok == Ponctuation_tok && - (int)LOCAL_tokptr->TokInfo == '}') { - t = MkAtomTerm(AtomBraces); - NextToken; - break; - } - t = ParseTerm(GLOBAL_MaxPriority, FailBuff, enc, cmod PASS_REGS); - t = Yap_MkApplTerm(FunctorBraces, 1, &t); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - checkfor('}', FailBuff, enc PASS_REGS); - break; - default: - syntax_msg("line %d: unexpected ponctuation signal %s",LOCAL_tokptr->TokPos, Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - break; - -#if QQ - case QuasiQuotes_tok: { - qq_t *qq = (qq_t *)(LOCAL_tokptr->TokInfo); - term_t pv, positions = LOCAL_subtpos, to; - Atom at; - Term tn; - CELL *tnp; - - // from SWI, enter the list - /* prepare (if we are the first in term) */ - if (!LOCAL_varnames) - LOCAL_varnames = PL_new_term_ref(); - if (!LOCAL_qq) { - if (LOCAL_quasi_quotations) { - LOCAL_qq = LOCAL_quasi_quotations; - } else { - if (!(LOCAL_qq = PL_new_term_ref())) - return FALSE; - } - // create positions term - if (positions) { - if (!(pv = PL_new_term_refs(3)) || - !PL_unify_term(positions, PL_FUNCTOR, - FUNCTOR_quasi_quotation_position5, PL_INTPTR, - qq->start.charno, PL_VARIABLE, PL_TERM, - pv + 0, // leave three open slots - PL_TERM, pv + 1, PL_TERM, pv + 2)) - return FALSE; - } else - pv = 0; - /* push type */ - - if (!(LOCAL_qq_tail = PL_copy_term_ref(LOCAL_qq))) - return FALSE; - } - - NextToken; - t = ParseTerm(GLOBAL_MaxPriority, FailBuff, enc, cmod PASS_REGS); - if (LOCAL_tokptr->Tok != QuasiQuotes_tok) { - syntax_msg("expected to find quasi quotes, got \"%s\"", , - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - if (!(is_quasi_quotation_syntax(t, &at))) { - syntax_msg("bad quasi quotation syntax, at \"%s\"", - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - /* Arg 2: the content */ - tn = Yap_MkNewApplTerm(SWIFunctorToFunctor(FUNCTOR_quasi_quotation4), 4); - tnp = RepAppl(tn) + 1; - tnp[0] = MkAtomTerm(at); - if (!get_quasi_quotation(Yap_InitSlot(ArgOfTerm(2, tn)), &qq->text, - qq->text + strlen((const char *)qq->text))) { - syntax_msg("could not get quasi quotation, at \"%s\"", - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - if (positions) { - intptr_t qqend = qq->end.charno; - - // set_range_position(positions, -1, qqend PASS_LD); - if (!PL_unify_term(Yap_InitSlot(ArgOfTerm(2, t)), PL_FUNCTOR, - FUNCTOR_minus2, PL_INTPTR, - qq->mid.charno + 2, /* end of | token */ - PL_INTPTR, qqend - 2)) /* end minus "|}" */ - syntax_msg("failed to unify quasi quotation, at \"%s\"", - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - - tnp[2] = Yap_GetFromSlot(LOCAL_varnames); /* Arg 3: the var dictionary */ - /* Arg 4: the result */ - t = ArgOfTerm(4, tn); - if (!(to = PL_new_term_ref()) || - !PL_unify_list(LOCAL_qq_tail, to, LOCAL_qq_tail) || - !PL_unify(to, Yap_InitSlot(tn))) { - syntax_msg("failed to unify quasi quotation, at \"%s\"", - Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - } -#endif - NextToken; - break; - default: - syntax_msg("line %d: expected operator, got \'%s\'",LOCAL_tokptr->TokPos, Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - - /* main loop to parse infix and posfix operators starts here */ - while (true) { - if (LOCAL_tokptr->Tok == Ord(Name_tok) && - Yap_HasOp((Atom)(LOCAL_tokptr->TokInfo))) { - Atom save_opinfo = opinfo = (Atom)(LOCAL_tokptr->TokInfo); - if (IsInfixOp(save_opinfo, &opprio, &oplprio, &oprprio, cmod PASS_REGS) && - opprio <= prio && oplprio >= curprio) { - /* try parsing as infix operator */ - Volatile int oldprio = curprio; - TRY3( - func = Yap_MkFunctor((Atom)LOCAL_tokptr->TokInfo, 2); - if (func == NULL) { - syntax_msg("line %d: Heap Overflow",LOCAL_tokptr->TokPos); - FAIL; - } NextToken; - { - Term args[2]; - args[0] = t; - args[1] = ParseTerm(oprprio, FailBuff,enc, cmod PASS_REGS); - t = Yap_MkApplTerm(func, 2, args); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - }, - curprio = opprio; - opinfo = save_opinfo; continue;, opinfo = save_opinfo; - curprio = oldprio;) - } - if (IsPosfixOp(opinfo, &opprio, &oplprio, cmod PASS_REGS) && opprio <= prio && - oplprio >= curprio) { - /* parse as posfix operator */ - Functor func = Yap_MkFunctor((Atom)LOCAL_tokptr->TokInfo, 1); - if (func == NULL) { - syntax_msg("line %d: Heap Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - t = Yap_MkApplTerm(func, 1, &t); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - curprio = opprio; - NextToken; - continue; - } - break; - } - if (LOCAL_tokptr->Tok == Ord(Ponctuation_tok)) { - if (Unsigned(LOCAL_tokptr->TokInfo) == ',' && prio >= 1000 && - curprio <= 999) { - Volatile Term args[2]; - NextToken; - args[0] = t; - args[1] = ParseTerm(1000, FailBuff, enc, cmod PASS_REGS); - t = Yap_MkApplTerm(FunctorComma, 2, args); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - curprio = 1000; - continue; - } else if (Unsigned(LOCAL_tokptr->TokInfo) == '|' && - IsInfixOp(AtomVBar, &opprio, &oplprio, &oprprio, cmod PASS_REGS) && - opprio <= prio && oplprio >= curprio) { - Volatile Term args[2]; - NextToken; - args[0] = t; - args[1] = ParseTerm(oprprio, FailBuff, enc, cmod PASS_REGS); - t = Yap_MkApplTerm(FunctorVBar, 2, args); - /* check for possible overflow against local stack */ - if (HR > ASP - 4096) { - syntax_msg("line %d: Stack Overflow",LOCAL_tokptr->TokPos); - FAIL; - } - curprio = opprio; - continue; - } else if (Unsigned(LOCAL_tokptr->TokInfo) == '(' && - IsPosfixOp(AtomEmptyBrackets, &opprio, &oplprio, cmod PASS_REGS) && - opprio <= prio && oplprio >= curprio) { - t = ParseArgs(AtomEmptyBrackets, ')', FailBuff, t, enc, cmod PASS_REGS); - curprio = opprio; - continue; - } else if (Unsigned(LOCAL_tokptr->TokInfo) == '[' && - IsPosfixOp(AtomEmptySquareBrackets, &opprio, - &oplprio, cmod PASS_REGS) && - opprio <= prio && oplprio >= curprio) { - t = ParseArgs(AtomEmptySquareBrackets, ']', FailBuff, t, enc, cmod PASS_REGS); - t = MakeAccessor(t, FunctorEmptySquareBrackets PASS_REGS); - curprio = opprio; - continue; - } else if (Unsigned(LOCAL_tokptr->TokInfo) == '{' && - IsPosfixOp(AtomEmptyCurlyBrackets, &opprio, - &oplprio, cmod PASS_REGS) && - opprio <= prio && oplprio >= curprio) { - t = ParseArgs(AtomEmptyCurlyBrackets, '}', FailBuff, t, enc, cmod PASS_REGS); - t = MakeAccessor(t, FunctorEmptyCurlyBrackets PASS_REGS); - curprio = opprio; - continue; - } - } - if (LOCAL_tokptr->Tok <= Ord(WString_tok)) { - syntax_msg("line %d: expected operator, got \'%s\'",LOCAL_tokptr->TokPos, Yap_tokRep(LOCAL_tokptr, enc)); - FAIL; - } - break; - } - return t; -} - -Term Yap_Parse(UInt prio, encoding_t enc, Term cmod) { - CACHE_REGS - Volatile Term t; - JMPBUFF FailBuff; - yhandle_t sls = Yap_StartSlots(); - - if (!sigsetjmp(FailBuff.JmpBuff, 0)) { - - t = ParseTerm(prio, &FailBuff, enc, cmod PASS_REGS); -#if DEBUG - if (GLOBAL_Option['p' - 'a' + 1]) { - Yap_DebugPutc(stderr, '['); - if (t == 0) - Yap_DebugPlWrite(MkIntTerm(0)); - else - Yap_DebugPlWrite(t); - Yap_DebugPutc(stderr, ']'); - Yap_DebugPutc(stderr, '\n'); - } -#endif - Yap_CloseSlots(sls); - if (LOCAL_tokptr != NULL && LOCAL_tokptr->Tok != Ord(eot_tok)) { - LOCAL_Error_TYPE = SYNTAX_ERROR; - LOCAL_ErrorMessage = "term does not end on . "; - t = 0; - } - if (t != 0 && LOCAL_Error_TYPE == SYNTAX_ERROR) { - LOCAL_Error_TYPE = YAP_NO_ERROR; - LOCAL_ErrorMessage = NULL; - } - // if (LOCAL_tokptr->Tok != Ord(eot_tok)) - // return (0L); - return t; - } - Yap_CloseSlots(sls); - - return (0); -} - -//! @} diff --git a/C/range.c b/C/range.c index 378621347..71c0efd94 100644 --- a/C/range.c +++ b/C/range.c @@ -21,7 +21,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" static Int p_in_range( USES_REGS1 ) { diff --git a/C/scanner.c b/C/scanner.c index 015d7c72b..0b3b2570c 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -407,7 +407,7 @@ writing, writing a BOM can be requested using the option #include "YapHeap.h" #include "Yatom.h" #include "alloc.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" /* stuff we want to use in standard YAP code */ #include "YapText.h" @@ -1143,17 +1143,17 @@ Term Yap_scan_num(StreamDesc *inp, bool error_on) { out = 0; } #if HAVE_ISWSPACE - while (iswspace(ch = getchr(inp))) - ; + while (iswspace(ch = getchr(inp))) + ; #else - while (isspace(ch = getchr(inp))) - ; + while (isspace(ch = getchr(inp))) + ; #endif if (LOCAL_ErrorMessage != NULL || ch != -1 || cherr) { - Yap_clean_tokenizer(old_tr, NULL, NULL); - if (error_on) + Yap_clean_tokenizer(old_tr, NULL, NULL); + if (error_on) Yap_Error(SYNTAX_ERROR, ARG2, "converting number"); - return 0; + return 0; } return out; } @@ -1172,85 +1172,89 @@ Term Yap_scan_num(StreamDesc *inp, bool error_on) { } Term Yap_tokRep(void *tokptre) { - CACHE_REGS - TokEntry *tokptr = tokptre; - Term info = tokptr->TokInfo; - - switch (tokptr->Tok) { - case Name_tok: - if (!info) { - info = TermNil; - } - return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); - case QuasiQuotes_tok: - info = MkAtomTerm(Yap_LookupAtom("")); - return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); - case Number_tok: - return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); - break; - case Var_tok: { - Term t[2]; - VarEntry *varinfo = (VarEntry *)info; - if ((t[0]= varinfo->VarAdr) == TermNil) { - t[0] = varinfo->VarAdr = MkVarTerm(); - } - t[1] = MkAtomTerm((Atom)(varinfo->VarRep)); - return Yap_MkApplTerm(Yap_MkFunctor(AtomGVar, 2), 2, t); - } - case String_tok: - return Yap_MkApplTerm(Yap_MkFunctor(AtomString, 1), 1, &info); - case BQString_tok: - return Yap_MkApplTerm(Yap_MkFunctor(AtomString, 1), 1, &info); - case Error_tok: - return MkAtomTerm(AtomError); - case eot_tok: - return MkAtomTerm(Yap_LookupAtom("EOT")); - case Ponctuation_tok: - return info; + CACHE_REGS + TokEntry *tokptr = tokptre; + Term info = tokptr->TokInfo; + + switch (tokptr->Tok) { + case Name_tok: + if (!info) { + info = TermNil; } - return TermDot; + return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); + case QuasiQuotes_tok: + info = MkAtomTerm(Yap_LookupAtom("")); + return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); + case Number_tok: + return Yap_MkApplTerm(Yap_MkFunctor(AtomAtom, 1), 1, &info); + break; + case Var_tok: { + Term t[2]; + VarEntry *varinfo = (VarEntry *)info; + if ((t[0] = varinfo->VarAdr) == TermNil) { + t[0] = varinfo->VarAdr = MkVarTerm(); + } + t[1] = MkAtomTerm((Atom)(varinfo->VarRep)); + return Yap_MkApplTerm(Yap_MkFunctor(AtomGVar, 2), 2, t); + } + case String_tok: + return Yap_MkApplTerm(Yap_MkFunctor(AtomString, 1), 1, &info); + case BQString_tok: + return Yap_MkApplTerm(Yap_MkFunctor(AtomString, 1), 1, &info); + case Error_tok: + return MkAtomTerm(AtomError); + case eot_tok: + return MkAtomTerm(Yap_LookupAtom("EOT")); + case Ponctuation_tok: + if (info == Terml) + return TermBeginBracket; + else + return info; + } + return TermDot; } +const char *Yap_tokText(void *tokptre) { + CACHE_REGS + TokEntry *tokptr = tokptre; + Term info = tokptr->TokInfo; -const char * Yap_tokText(void *tokptre) { - CACHE_REGS - TokEntry *tokptr = tokptre; - Term info = tokptr->TokInfo; - - switch (tokptr->Tok) { - case eot_tok: - return "EOT"; - case Ponctuation_tok: - case Error_tok: - case BQString_tok: - case String_tok: - case Name_tok: - return AtomOfTerm(info)->StrOfAE; - case QuasiQuotes_tok: - return ""; - case Number_tok: - if (IsIntegerTerm(info)) { - char *s = Malloc(36); - snprintf(s, 35, Int_FORMAT, IntegerOfTerm(info)); - return s; - }else if (IsFloatTerm(info)) { - char *s = Malloc( 64); - snprintf(s, 63, "%6g", FloatOfTerm(info)); - return s; - } else { - size_t len = Yap_gmp_to_size(info,10); - char *s = Malloc(len+2); - return Yap_gmp_to_string(info,s, len+1,10); - } - break; - case Var_tok: - if (info == 0) return "[]"; - return ((Atom)info)->StrOfAE; + switch (tokptr->Tok) { + case eot_tok: + return "EOT"; + case Ponctuation_tok: + if (info == Terml) + return "("; + case Error_tok: + case BQString_tok: + case String_tok: + case Name_tok: + return AtomOfTerm(info)->StrOfAE; + case QuasiQuotes_tok: + return ""; + case Number_tok: + if (IsIntegerTerm(info)) { + char *s = Malloc(36); + snprintf(s, 35, Int_FORMAT, IntegerOfTerm(info)); + return s; + } else if (IsFloatTerm(info)) { + char *s = Malloc(64); + snprintf(s, 63, "%6g", FloatOfTerm(info)); + return s; + } else { + size_t len = Yap_gmp_to_size(info, 10); + char *s = Malloc(len + 2); + return Yap_gmp_to_string(info, s, len + 1, 10); } - return "."; + break; + case Var_tok: + if (info == 0) + return "[]"; + return ((Atom)info)->StrOfAE; + } + return "."; } - static void open_comment(int ch, StreamDesc *inp_stream USES_REGS) { CELL *h0 = HR; HR += 5; @@ -1311,7 +1315,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, int solo_flag = TRUE; int32_t ch, och; struct qq_struct_t *cur_qq = NULL; - int sign = 1; + int sign = 1; InitScannerMemory(); LOCAL_VarTable = NULL; @@ -1424,7 +1428,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, Atom ae; /* don't do this in iso */ ae = Yap_ULookupAtom(TokImage); - Free(TokImage); + Free(TokImage); if (ae == NIL) { return CodeSpaceError(t, p, l); } @@ -1434,7 +1438,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, t->Tok = Ord(kind = Name_tok); } else { VarEntry *ve = Yap_LookupVar((const char *)TokImage); - Free(TokImage); + Free(TokImage); t->TokInfo = Unsigned(ve); if (cur_qq) { ve->refs++; @@ -1444,14 +1448,14 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, } break; - case NU: { + case NU: { int cherr; int cha; - sign = 1; + sign = 1; - scan_number: - cha = ch; - cherr = 0; + scan_number: + cha = ch; + cherr = 0; CHECK_SPACE(); if ((t->TokInfo = get_num(&cha, &cherr, inp_stream, sign)) == 0L) { if (p) { @@ -1480,8 +1484,8 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, case 'e': case 'E': och = cherr; - TokImage = Malloc(1024 PASS_REGS); - goto scan_name; + TokImage = Malloc(1024 PASS_REGS); + goto scan_name; break; case '=': case '_': @@ -1513,13 +1517,13 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, { TokEntry *e2; - if (chtype(ch) == NU) { - if (och == '-') - sign = -1; - else - sign = 1; - goto scan_number; - } + if (chtype(ch) == NU) { + if (och == '-') + sign = -1; + else + sign = 1; + goto scan_number; + } t->Tok = Name_tok; if (ch == '(') solo_flag = FALSE; @@ -1567,9 +1571,9 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, LOCAL_ErrorMessage = "layout character \n inside quotes"; break; } - if (ch == EOFCHAR) { - break; - } + if (ch == EOFCHAR) { + break; + } if (ch == quote) { ch = getchrq(inp_stream); if (ch != quote) @@ -1638,16 +1642,16 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, break; case SY: { int pch; - if (ch == '.' && (pch = Yap_peek(inp_stream - GLOBAL_Stream)) && - (chtype(pch) == BS || chtype(pch) == EF || pch == '%')) { - t->Tok = Ord(kind = eot_tok); - // consume... - if (pch == '%') { - t->TokInfo = TermNewLine; - return l; - } - return l; + if (ch == '.' && (pch = Yap_peek(inp_stream - GLOBAL_Stream)) && + (chtype(pch) == BS || chtype(pch) == EF || pch == '%')) { + t->Tok = Ord(kind = eot_tok); + // consume... + if (pch == '%') { + t->TokInfo = TermNewLine; + return l; } + return l; + } if (ch == '`') goto quoted_string; och = ch; @@ -1668,7 +1672,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, return l; } } - if (och == '/' && ch == '*') { + if (och == '/' && ch == '*') { if (store_comments) { CHECK_SPACE(); open_comment('/', inp_stream PASS_REGS); @@ -1925,7 +1929,7 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, qq->end.byteno = fseek(inp_stream->file, 0, 0); } else { qq->end.byteno = inp_stream->charcount - 1; - } + } qq->end.lineno = inp_stream->linecount; qq->end.linepos = inp_stream->linepos - 1; qq->end.charno = inp_stream->charcount - 1; @@ -1972,7 +1976,6 @@ TokEntry *Yap_tokenizer(struct stream_desc *inp_stream, bool store_comments, return (l); } - void Yap_clean_tokenizer(TokEntry *tokstart, VarEntry *vartable, VarEntry *anonvartable) { CACHE_REGS diff --git a/C/signals.c b/C/signals.c index 9fe5c8d60..5d87ce6dc 100755 --- a/C/signals.c +++ b/C/signals.c @@ -25,18 +25,18 @@ static char SccsId[] = "%W% %G%"; #include #endif #if _WIN32 -#include #include +#include #endif -#include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "Yatom.h" +#include "YapEval.h" #include "yapio.h" #ifdef TABLING #include "tab.macros.h" #endif /* TABLING */ -#include #include +#include #if HAVE_STRING_H #include #endif @@ -63,7 +63,11 @@ static yap_signals InteractSIGINT(int ch) { #endif switch (ch) { case 'a': - /* abort computation */ +/* abort computation */ +#if PUSH_REGS +// restore_absmi_regs(&Yap_standard_regs); +#endif + siglongjmp(&LOCAL_RestartEnv, 4); return YAP_ABORT_SIGNAL; case 'b': /* continue */ @@ -183,35 +187,32 @@ inline static bool get_signal(yap_signals sig USES_REGS) { #endif } -bool Yap_DisableInterrupts(int wid) -{ +bool Yap_DisableInterrupts(int wid) { LOCAL_InterruptsDisabled = true; YAPEnterCriticalSection(); return true; } -bool Yap_EnableInterrupts(int wid) -{ +bool Yap_EnableInterrupts(int wid) { LOCAL_InterruptsDisabled = false; YAPLeaveCriticalSection(); return true; } - /** Function called to handle delayed interrupts. */ -int Yap_HandleInterrupts(void) { +bool Yap_HandleSIGINT(void) { CACHE_REGS yap_signals sig; - if (get_signal(YAP_INT_SIGNAL PASS_REGS)) { + do { if ((sig = ProcessSIGINT()) != YAP_NO_SIGNAL) do_signal(worker_id, sig PASS_REGS); LOCAL_PrologMode &= ~InterruptMode; - return 1; - } - return 0; + return true; + } while (get_signal(YAP_INT_SIGNAL PASS_REGS)); + return false; } static Int p_creep(USES_REGS1) { diff --git a/C/stack.c b/C/stack.c index e8a6ec09e..c1bb25b7a 100644 --- a/C/stack.c +++ b/C/stack.c @@ -30,7 +30,7 @@ #include "Yap.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #include "iopreds.h" #include "tracer.h" #include "yapio.h" diff --git a/C/stackinfo.c b/C/stackinfo.c index 10a7c7ce6..b61621b4b 100644 --- a/C/stackinfo.c +++ b/C/stackinfo.c @@ -31,7 +31,7 @@ #include "Yap.h" #include "clause.h" #include "yapio.h" -#include "eval.h" +#include "YapEval.h" #include "tracer.h" #ifdef YAPOR #include "or.macros.h" diff --git a/C/stdpreds.c b/C/stdpreds.c index e62665634..f9a0b7cdd 100755 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -37,7 +37,7 @@ static char SccsId[] = "%W% %G%"; #include "Foreign.h" #include "YapHeap.h" #include "Yatom.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #ifdef TABLING #include "tab.macros.h" @@ -58,6 +58,9 @@ static char SccsId[] = "%W% %G%"; #include #include +extern int init_tries(void); + + static Int p_setval(USES_REGS1); static Int p_value(USES_REGS1); static Int p_values(USES_REGS1); @@ -74,7 +77,7 @@ static Int p_halt(USES_REGS1); #endif static Int current_predicate(USES_REGS1); static Int cont_current_predicate(USES_REGS1); -static OpEntry *NextOp(OpEntry *CACHE_TYPE); +static OpEntry *NextOp(Prop CACHE_TYPE); static Int init_current_op(USES_REGS1); static Int cont_current_op(USES_REGS1); static Int init_current_atom_op(USES_REGS1); @@ -943,22 +946,24 @@ static Int current_predicate(USES_REGS1) { return cont_current_predicate(PASS_REGS1); } -static OpEntry *NextOp(OpEntry *pp USES_REGS) { +static OpEntry *NextOp(Prop pp USES_REGS) { + while (!EndOfPAEntr(pp) && pp->KindOfPE != OpProperty && - (pp->OpModule != PROLOG_MODULE || pp->OpModule != CurrentModule)) - pp = RepOpProp(pp->NextOfPE); - return (pp); + (RepOpProp(pp)->OpModule != PROLOG_MODULE + || RepOpProp(pp)->OpModule != CurrentModule) ) + pp = pp->NextOfPE; + return RepOpProp(pp); } int Yap_IsOp(Atom at) { CACHE_REGS - OpEntry *op = NextOp(RepOpProp((Prop)(RepAtom(at)->PropsOfAE)) PASS_REGS); + OpEntry *op = NextOp(RepAtom(at)->PropsOfAE PASS_REGS); return (!EndOfPAEntr(op)); } int Yap_IsOpMaxPrio(Atom at) { CACHE_REGS - OpEntry *op = NextOp(RepOpProp((Prop)(RepAtom(at)->PropsOfAE)) PASS_REGS); + OpEntry *op = NextOp(RepAtom(at)->PropsOfAE PASS_REGS); int max; if (EndOfPAEntr(op)) @@ -1020,7 +1025,7 @@ static Int cont_current_atom_op(USES_REGS1) { OpEntry *op = (OpEntry *)IntegerOfTerm(EXTRA_CBACK_ARG(5, 1)), *next; READ_LOCK(op->OpRWLock); - next = NextOp(RepOpProp(op->NextOfPE) PASS_REGS); + next = NextOp(op->NextOfPE PASS_REGS); if (unify_op(op PASS_REGS)) { READ_UNLOCK(op->OpRWLock); if (next) { @@ -1053,7 +1058,7 @@ static Int init_current_atom_op( cut_fail(); } ae = RepAtom(AtomOfTerm(t)); - if (EndOfPAEntr((ope = NextOp(RepOpProp(ae->PropsOfAE) PASS_REGS)))) { + if (EndOfPAEntr((ope = NextOp(ae->PropsOfAE PASS_REGS)))) { cut_fail(); } EXTRA_CBACK_ARG(5, 1) = (CELL)MkIntegerTerm((Int)ope); @@ -1074,7 +1079,7 @@ static Int cut_fail(); } ae = RepAtom(AtomOfTerm(t)); - if (EndOfPAEntr((ope = NextOp(RepOpProp(ae->PropsOfAE) PASS_REGS)))) { + if (EndOfPAEntr((ope = NextOp(ae->PropsOfAE PASS_REGS)))) { cut_fail(); } EXTRA_CBACK_ARG(5, 1) = (CELL)MkIntegerTerm((Int)ope); @@ -1629,7 +1634,6 @@ void Yap_InitCPreds(void) { #if SUPPORT_CONDOR init_sys(); init_random(); - // init_tries(); init_regexp(); #endif } diff --git a/C/text.c b/C/text.c index 66b83dbea..038abf6c5 100644 --- a/C/text.c +++ b/C/text.c @@ -16,10 +16,10 @@ *************************************************************************/ #include "Yap.h" +#include "YapEval.h" #include "YapHeap.h" #include "YapText.h" #include "Yatom.h" -#include "eval.h" #include "yapio.h" #include @@ -51,9 +51,7 @@ typedef struct TextBuffer_manager { int lvl; } text_buffer_t; -int push_text_stack(USES_REGS1) { - return LOCAL_TextBuffer->lvl++; -} +int push_text_stack(USES_REGS1) { return LOCAL_TextBuffer->lvl++; } int pop_text_stack(int i) { int lvl = LOCAL_TextBuffer->lvl; @@ -72,6 +70,33 @@ int pop_text_stack(int i) { return lvl; } +void *protected_pop_text_stack(int i, void *protected, bool tmp, + size_t sz USES_REGS) { + void *out = protected; + int lvl = LOCAL_TextBuffer->lvl; + while (lvl > i) { + struct mblock *p = LOCAL_TextBuffer->first[lvl]; + while (p) { + struct mblock *np = p->next; + if (p + 1 == protected) { + if (tmp) + out = LOCAL_FileNameBuf; + else + out = p; + memcpy(out, protected, sz); + } else { + free(p); + } + p = np; + } + LOCAL_TextBuffer->first[lvl] = NULL; + LOCAL_TextBuffer->last[lvl] = NULL; + lvl--; + } + LOCAL_TextBuffer->lvl = lvl; + return out; +} + // void pop_text_stack(int i) { LOCAL_TextBuffer->lvl = i; } void *Malloc(size_t sz USES_REGS) { @@ -81,9 +106,9 @@ void *Malloc(size_t sz USES_REGS) { sz = ALIGN_BY_TYPE(sz + sizeof(struct mblock), CELL); struct mblock *o = malloc(sz); o->prev = LOCAL_TextBuffer->last[lvl]; - if (o->prev) { - o->prev->next = o; - } + if (o->prev) { + o->prev->next = o; + } if (LOCAL_TextBuffer->first[lvl]) { LOCAL_TextBuffer->last[lvl] = o; } else { @@ -111,6 +136,7 @@ void *Realloc(void *pt, size_t sz USES_REGS) { if (LOCAL_TextBuffer->last[lvl] == old) { LOCAL_TextBuffer->last[lvl] = o; } + return o + 1; } @@ -206,7 +232,7 @@ static Int SkipListCodes(unsigned char **bufp, Term *l, Term **tailp, (*atoms)++; if (*atoms < length) { *tailp = l; - return -REPRESENTATION_ERROR_CHARACTER_CODE; + return -REPRESENTATION_ERROR_CHARACTER_CODE; } else { AtomEntry *ae = RepAtom(AtomOfTerm(hd)); if ((ae->StrOfAE)[1] != '\0') { @@ -356,10 +382,16 @@ static yap_error_number gen_type_error(int flags) { } #endif +// static int cnt; + unsigned char *Yap_readText(seq_tv_t *inp, size_t *lengp) { unsigned char *s0 = NULL; bool wide; + if (LOCAL_Error_TYPE != YAP_NO_ERROR) { + fprintf(stderr, "Sourious error %u\n", LOCAL_Error_TYPE); + LOCAL_Error_TYPE = YAP_NO_ERROR; + } /* we know what the term is */ if (!(inp->type & (YAP_STRING_CHARS | YAP_STRING_WCHARS))) { if (!(inp->type & YAP_STRING_TERM)) { @@ -386,82 +418,67 @@ unsigned char *Yap_readText(seq_tv_t *inp, size_t *lengp) { // this is a term, extract to a buffer, and representation is wide // Yap_DebugPlWriteln(inp->val.t); Atom at = AtomOfTerm(inp->val.t); - if (lengp) - *lengp = strlen_utf8(at->UStrOfAE); + if (lengp) + *lengp = strlen(at->StrOfAE); return at->UStrOfAE; } if (IsStringTerm(inp->val.t) && inp->type & YAP_STRING_STRING) { // this is a term, extract to a buffer, and representation is wide // Yap_DebugPlWriteln(inp->val.t); - if (lengp) - *lengp = strlen_utf8(UStringOfTerm(inp->val.t)); - return (unsigned char *)UStringOfTerm(inp->val.t); + if (lengp) + *lengp = strlen(StringOfTerm(inp->val.t)); + return (unsigned char *)UStringOfTerm(inp->val.t); } if (((inp->type & (YAP_STRING_CODES | YAP_STRING_ATOMS)) == (YAP_STRING_CODES | YAP_STRING_ATOMS)) && IsPairOrNilTerm(inp->val.t)) { // Yap_DebugPlWriteln(inp->val.t); - return - Yap_ListToBuffer(s0, inp->val.t, inp, &wide, lengp PASS_REGS); + return Yap_ListToBuffer(s0, inp->val.t, inp, &wide, lengp PASS_REGS); // this is a term, extract to a sfer, and representation is wide } if (inp->type & YAP_STRING_CODES && IsPairOrNilTerm(inp->val.t)) { // Yap_DebugPlWriteln(inp->val.t); - return Yap_ListOfCodesToBuffer(s0, inp->val.t, inp, &wide, - lengp PASS_REGS); + return Yap_ListOfCodesToBuffer(s0, inp->val.t, inp, &wide, lengp PASS_REGS); // this is a term, extract to a sfer, and representation is wide } if (inp->type & YAP_STRING_ATOMS && IsPairOrNilTerm(inp->val.t)) { // Yap_DebugPlWriteln(inp->val.t); - return Yap_ListOfAtomsToBuffer(s0, inp->val.t, inp, &wide, - lengp PASS_REGS); + return Yap_ListOfAtomsToBuffer(s0, inp->val.t, inp, &wide, lengp PASS_REGS); // this is a term, extract to a buffer, and representation is wide } if (inp->type & YAP_STRING_INT && IsIntegerTerm(inp->val.t)) { // ASCII, so both LATIN1 and UTF-8 // Yap_DebugPlWriteln(inp->val.t); char *s; - if (s0) - s = (char *)s0; - else - s = Malloc(0); + s = Malloc(0); if (snprintf(s, MaxTmp(PASS_REGS1) - 1, Int_FORMAT, IntegerOfTerm(inp->val.t)) < 0) { AUX_ERROR(inp->val.t, 2 * MaxTmp(PASS_REGS1), s, char); } - *lengp = strlen(s); + if (lengp) + *lengp = strlen(s); return (unsigned char *)s; } if (inp->type & YAP_STRING_FLOAT && IsFloatTerm(inp->val.t)) { char *s; - size_t sz = 1024; // Yap_DebugPlWriteln(inp->val.t); - if (s0) - { s = (char *)s0; sz = strlen(s);} - else - s = Malloc(sz); - if (!s) - AUX_ERROR(inp->val.t, MaxTmp(PASS_REGS1), s, char); - while (!Yap_FormatFloat(FloatOfTerm(inp->val.t), &s, sz - 1)) { - if (s0) { s = Malloc(sz=1024); s0 = NULL; } - else s = Realloc(s, sz+1024); + if (!Yap_FormatFloat(FloatOfTerm(inp->val.t), &s, 1024)) { + return NULL; } - *lengp = strlen(s); - return inp->val.uc = (unsigned char *)s; + if (lengp) + *lengp = strlen(s); + return (unsigned char *)s; } #if USE_GMP if (inp->type & YAP_STRING_BIG && IsBigIntTerm(inp->val.t)) { // Yap_DebugPlWriteln(inp->val.t); char *s; - if (s0) - s = 0; - else s = Malloc(0); if (!Yap_mpz_to_string(Yap_BigIntOfTerm(inp->val.t), s, MaxTmp() - 1, 10)) { AUX_ERROR(inp->val.t, MaxTmp(PASS_REGS1), s, char); } - *lengp = strlen(s); - Malloc(*lengp); + if (lengp) + *lengp = strlen(s); return inp->val.uc = (unsigned char *)s; } #endif @@ -471,18 +488,17 @@ unsigned char *Yap_readText(seq_tv_t *inp, size_t *lengp) { return inp->val.uc = (unsigned char *)s; } if (inp->type & YAP_STRING_CHARS) { - // printf("%s\n",inp->val.c); - if (inp->enc == ENC_ISO_UTF8) { - if (lengp) - *lengp = strlen_utf8(inp->val.uc); - return inp->val.uc; - } else if (inp->enc == ENC_ISO_LATIN1) { + if (inp->enc == ENC_ISO_LATIN1) { return latin2utf8(inp, lengp); } else if (inp->enc == ENC_ISO_ASCII) { if (lengp) *lengp = strlen(inp->val.c); return inp->val.uc; - } + }else { //if (inp->enc == ENC_ISO_UTF8) { + if (lengp) + *lengp = strlen(inp->val.c); + return inp->val.uc; + } } if (inp->type & YAP_STRING_WCHARS) { // printf("%S\n",inp->val.w); @@ -634,11 +650,11 @@ static Term write_codes(void *s0, seq_tv_t *out, size_t leng USES_REGS) { static Atom write_atom(void *s0, seq_tv_t *out, size_t leng USES_REGS) { unsigned char *s = s0; int32_t ch; - if ( leng == 0) { - return Yap_LookupAtom(""); - } - if ( strlen_utf8(s0) <= leng) { - return Yap_LookupAtom(s0); + if (leng == 0) { + return Yap_LookupAtom(""); + } + if (strlen_utf8(s0) <= leng) { + return Yap_LookupAtom(s0); } else { size_t n = get_utf8(s, 1, &ch); unsigned char *buf = Malloc(n + 1); @@ -651,7 +667,7 @@ size_t write_buffer(unsigned char *s0, seq_tv_t *out, size_t leng USES_REGS) { size_t min = 0, max = leng, room_end; if (out->enc == ENC_ISO_UTF8) { room_end = strlen((char *)s0) + 1; - if (out->val.uc == NULL) { + if (out->val.uc == NULL) { // this should always be the case out->val.uc = malloc(room_end < 16 ? 16 : room_end); } if (out->val.uc != s0) { @@ -720,18 +736,18 @@ static size_t write_length(const unsigned char *s0, seq_tv_t *out, return leng; } -static Term write_number(unsigned char *s, seq_tv_t *out, int size, bool error_on USES_REGS) { +static Term write_number(unsigned char *s, seq_tv_t *out, int size, + bool error_on USES_REGS) { Term t; int i = push_text_stack(); t = Yap_StringToNumberTerm((char *)s, &out->enc, error_on); - pop_text_stack(i); - return t; + pop_text_stack(i); + return t; } static Term string_to_term(void *s, seq_tv_t *out, size_t leng USES_REGS) { Term o; - o = out->val.t = - Yap_StringToTerm(s, strlen(s) + 1, &out->enc, GLOBAL_MaxPriority, 0L); + o = out->val.t = Yap_BufferToTerm(s, strlen(s) + 1, TermNil); return o; } @@ -746,7 +762,8 @@ bool write_Text(unsigned char *inp, seq_tv_t *out, size_t leng USES_REGS) { return out->val.t != 0; } if (out->type & (YAP_STRING_INT | YAP_STRING_FLOAT | YAP_STRING_BIG)) { - if ((out->val.t = write_number(inp, out, leng,!(out->type & YAP_STRING_ATOM) PASS_REGS)) != 0L) { + if ((out->val.t = write_number( + inp, out, leng, !(out->type & YAP_STRING_ATOM) PASS_REGS)) != 0L) { // Yap_DebugPlWriteln(out->val.t); return true; @@ -800,7 +817,7 @@ bool write_Text(unsigned char *inp, seq_tv_t *out, size_t leng USES_REGS) { out->val.t = write_number(inp, out, leng, true PASS_REGS); // Yap_DebugPlWriteln(out->val.t); return out->val.t != 0; - default: { return true ; } + default: { return true; } } return false; } @@ -845,10 +862,11 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) { .w); else fprintf(stderr,"s %s\n", inp->val.c); */ + // cnt++; buf = Yap_readText(inp, &leng PASS_REGS); if (out->type & (YAP_STRING_NCHARS | YAP_STRING_TRUNC)) { if (out->max < leng) { - const unsigned char *ptr = skip_utf8(buf, leng); + const unsigned char *ptr = skip_utf8(buf, out->max); size_t diff = (ptr - buf); char *nbuf = Malloc(diff + 1); memcpy(nbuf, buf, diff); @@ -858,10 +876,10 @@ bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) { // else if (out->type & YAP_STRING_NCHARS && // const unsigned char *ptr = skip_utf8(buf, leng) } - if (!buf) { return 0L; } + if (out->type & (YAP_STRING_UPCASE | YAP_STRING_DOWNCASE)) { if (out->type & YAP_STRING_UPCASE) { if (!upcase(buf, out)) { @@ -917,9 +935,9 @@ static unsigned char *concat(int n, void *sv[] USES_REGS) { buf = Malloc(room + 1); buf0 = buf; for (i = 0; i < n; i++) { -#if _WIN32 || defined( __ANDROID__ ) +#if _WIN32 || defined(__ANDROID__) strcpy(buf, sv[i]); - buf = (char*)buf + strlen(buf); + buf = (char *)buf + strlen(buf); #else buf = stpcpy(buf, sv[i]); #endif @@ -1021,14 +1039,14 @@ bool Yap_Splice_Text(int n, size_t cuts[], seq_tv_t *inp, next = 0; else next = cuts[i - 1]; - if (i>0 && cuts[i] == 0) + if (i > 0 && cuts[i] == 0) break; void *bufi = slice(next, cuts[i], buf PASS_REGS); if (!write_Text(bufi, outv + i, cuts[i] - next PASS_REGS)) { return false; } } - + return true; } @@ -1085,7 +1103,7 @@ const char *Yap_TextTermToText(Term t, char *buf, size_t len, encoding_t enc) { const char *Yap_PredIndicatorToUTF8String(PredEntry *ap) { CACHE_REGS Atom at; - arity_t arity = 0; + arity_t arity = 0; Functor f; char *s, *smax, *s0; s = s0 = malloc(1024); diff --git a/C/threads.c b/C/threads.c index f875530f1..96f51175e 100644 --- a/C/threads.c +++ b/C/threads.c @@ -26,7 +26,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #include "yapio.h" #include "blobs.h" #include diff --git a/C/tracer.c b/C/tracer.c index f16d3de78..ebb1e0783 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -28,53 +28,88 @@ #include "tracer.h" #include "yapio.h" -static char *send_tracer_message(char *start, char *name, Int arity, - char *mname, CELL *args, char *s, char *top) { - if (name == NULL) { -#ifdef YAPOR - s += snprintf(s, top - s, "(%d)%s", worker_id, start); -#else - s += snprintf(s, top - s, "%s", start); -#endif - } else { - int i; +static char *send_tracer_message(char *start, char *name, arity_t arity, + char *mname, CELL *args, char **s0, char *s, + char **top) { + bool expand = false; + size_t max = *top - (s + 1); + int d, min = 1024; + char *s1 = s; + do { + if (expand || max < 32) { + Int cbeg = s1 - *s0; + max = *top - *s0; + max += min; + *s0 = Realloc(*s0, max); - if (arity) { - if (args) - s += snprintf(s, top - s, "%s %s:%s(", start, mname, name); - else - s += snprintf(s, top - s, "%s %s:%s/%lu", start, mname, name, - (unsigned long int)arity); - } else { - s += snprintf(s, top - s, "%s %s:%s", start, mname, name); + *top = *s0 + max; + max--; + s1 = *s0 + cbeg; + s = s1; + expand = false; } + min = 1024; + if (name == NULL) { +#ifdef YAPOR + d = snprintf(s, max, "(%d)%s", worker_id, start); +#else + d = snprintf(s, max, "%s", start); +#endif + } else { + + if (arity) { + if (args) + d = snprintf(s, max, "%s %s:%s(", start, mname, name); + else + d = snprintf(s, max, "%s %s:%s/%lu", start, mname, name, + (unsigned long int)arity); + } else { + d = snprintf(s, max, "%s %s:%s", start, mname, name); + } + } + if (d >= max) { + expand = true; + min = d + 1024; + continue; + } + max -= d; + s += d; if (args) { + int i; for (i = 0; i < arity; i++) { - size_t length = top - (s + 4); - if ((ssize_t)length < 16) { - s[0] = '\0'; - return s; - } - if (i > 0) { - *s++ = ','; + if (i > 0) { + if (max > 16) { + *s++ = ','; + *s++ = ' '; + max-=2; + } else { + expand = true; + continue; + } } - const char *sn = Yap_TermToString(args[i], NULL, LOCAL_encoding, + const char *sn = Yap_TermToString(args[i], NULL, LOCAL_encoding, Quote_illegal_f | Handle_vars_f); size_t sz; - if (sn != s) { - if (sn == NULL) { - sn = "<* error *>"; - } - strlcpy(s, sn, top - (s + 3)); + if (sn == NULL) { + sn = "<* error *>"; } - sz = strlen(s); + sz = strlen(sn); + if (max <= sz) { + min = sz + 1024; + expand = true; + continue; + } + strcpy(s, sn); s += sz; + max -= sz; } if (arity) { + *s++ = ' '; *s++ = ')'; + max -= 2; } } - } + } while (expand); s[0] = '\0'; return s; } @@ -154,22 +189,22 @@ check_area(void) jmp_deb(i); } */ - // PredEntry *old_p[10000]; // Term old_x1[10000], old_x2[10000], old_x3[10000]; // static CELL oldv = 0; -void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { +bool low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { CACHE_REGS char *s; char *mname; Int arity; + int l = push_text_stack(); /* extern int gc_calls; */ vsc_count++; // if (HR < ASP ) return; // fif (vsc_count == 12534) jmp_deb( 2 ); - char buf[512], *top = buf + 511, *b = buf; + char *buf = Malloc(512), *top = buf + 511, *b = buf; // if (!worker_id) return; LOCK(Yap_low_level_trace_lock); @@ -308,12 +343,10 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { while (env_ptr) { PredEntry *pe = EnvPreg(env_ptr[E_CP]); - printf("%p->", env_ptr, pe); - if (vsc_count == 52LL) - printf("\n"); if (p == pe) { UNLOCK(Yap_heap_regs->low_level_trace_lock); - return; + pop_text_stack(l); + ReleaseAndReturn(true); } if (env_ptr != NULL) env_ptr = (CELL *)(env_ptr[E_E]); @@ -329,12 +362,13 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { /* check_trail_consistency(); */ if (pred == NULL) { UNLOCK(Yap_low_level_trace_lock); - return; + pop_text_stack(l); + ReleaseAndReturn(true); } if (pred->ModuleOfPred == PROLOG_MODULE) { if (!LOCAL_do_trace_primitives) { UNLOCK(Yap_low_level_trace_lock); - return; + ReleaseAndReturn(true); } mname = "prolog"; } else { @@ -350,42 +384,45 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { } /* if ((pred->ModuleOfPred == 0) && (s[0] == '$')) return; */ - b = send_tracer_message("CALL: ", s, arity, mname, args, b, top); + b = send_tracer_message("CALL: ", s, arity, mname, args, &buf, b, &top); break; case try_or: - b = send_tracer_message("TRY_OR ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("TRY_OR ", NULL, 0, NULL, args, &buf, b, &top); break; case retry_or: - b = send_tracer_message("FAIL ", NULL, 0, NULL, args, b, top); - b = send_tracer_message("RETRY_OR ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("FAIL ", NULL, 0, NULL, args, &buf, b, &top); + b = send_tracer_message("RETRY_OR ", NULL, 0, NULL, args, &buf, b, &top); break; case retry_table_generator: - b = send_tracer_message("FAIL ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("FAIL ", NULL, 0, NULL, args, &buf, b, &top); mname = (char *)RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE; arity = pred->ArityOfPE; if (arity == 0) s = (char *)RepAtom((Atom)pred->FunctorOfPred)->StrOfAE; else s = (char *)RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE; - b = send_tracer_message("RETRY GENERATOR: ", s, arity, mname, args, b, top); + b = send_tracer_message("RETRY GENERATOR: ", s, arity, mname, args, &buf, b, + &top); break; case retry_table_consumer: - b = send_tracer_message("FAIL ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("FAIL ", NULL, 0, NULL, args, &buf, b, &top); mname = (char *)RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE; arity = pred->ArityOfPE; if (arity == 0) { s = (char *)RepAtom((Atom)pred->FunctorOfPred)->StrOfAE; - b = send_tracer_message("RETRY CONSUMER: ", s, 0, mname, NULL, b, top); + b = send_tracer_message("RETRY CONSUMER: ", s, 0, mname, NULL, &buf, b, + &top); } else { s = (char *)RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE; b = send_tracer_message("RETRY CONSUMER: ", s, pred->ArityOfPE, mname, - NULL, b, top); + NULL, &buf, b, &top); } break; case retry_table_loader: - b = send_tracer_message("FAIL ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("FAIL ", NULL, 0, NULL, args, &buf, b, &top); if (pred == UndefCode) { - b = send_tracer_message("RETRY LOADER ", NULL, 0, NULL, NULL, b, top); + b = send_tracer_message("RETRY LOADER ", NULL, 0, NULL, NULL, &buf, b, + &top); } else { mname = (char *)RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE; arity = pred->ArityOfPE; @@ -393,11 +430,12 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { s = (char *)RepAtom((Atom)pred->FunctorOfPred)->StrOfAE; else s = (char *)RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE; - b = send_tracer_message("RETRY LOADER: ", s, 0, mname, NULL, b, top); + b = send_tracer_message("RETRY LOADER: ", s, 0, mname, NULL, &buf, b, + &top); } break; case retry_pred: - b = send_tracer_message("FAIL ", NULL, 0, NULL, args, b, top); + b = send_tracer_message("FAIL ", NULL, 0, NULL, args, &buf, b, &top); if (pred != NULL) { mname = (char *)RepAtom(AtomOfTerm(Yap_Module_Name(pred)))->StrOfAE; arity = pred->ArityOfPE; @@ -409,7 +447,7 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { } else { s = (char *)RepAtom(NameOfFunctor((pred->FunctorOfPred)))->StrOfAE; } - b = send_tracer_message("RETRY: ", s, arity, mname, args, b, top); + b = send_tracer_message("RETRY: ", s, arity, mname, args, &buf, b, &top); } break; } @@ -418,9 +456,11 @@ void low_level_trace__(yap_low_level_port port, PredEntry *pred, CELL *args) { __android_log_print(ANDROID_LOG_DEBUG, "YAPDroid", "%s\n", buf); #else *b++ = '\n'; - *b++ = '\0'; + *b = '\0'; fputs(buf, stderr); #endif + pop_text_stack(l); + ReleaseAndReturn(true); } void toggle_low_level_trace(void) { @@ -442,7 +482,7 @@ static Int reset_total_choicepoints(USES_REGS1) { } static Int show_low_level_trace(USES_REGS1) { - fprintf(stderr, "Call counter=%lld\n", vsc_count); + fprintf(stderr, "Call counter=%llu\n", vsc_count); return (TRUE); } diff --git a/C/write.c b/C/write.c index 91064bdd7..b84b0a14d 100644 --- a/C/write.c +++ b/C/write.c @@ -385,15 +385,16 @@ int Yap_FormatFloat(Float f, char **s, size_t sz) { sno = Yap_open_buf_write_stream(GLOBAL_Stream[LOCAL_c_output_stream].encoding, 0); if (sno < 0) - return FALSE; + return false; wglb.lw = separator; wglb.stream = GLOBAL_Stream + sno; wrputf(f, &wglb); wrputc('\0', wglb.stream); so = Yap_MemExportStreamPtr(sno); + *s = Malloc( strlen(so) )+1; + strcpy(*s, so ); Yap_CloseStream(sno); - *s = so; - return TRUE; + return true; } /* writes a data base reference */ @@ -567,12 +568,13 @@ static void write_string(const unsigned char *s, do { int delta; ptr += (delta = get_utf8(ptr, -1, &chr) ); - - if (chr == '\0') + + if (chr == '\0') { break; - if (delta == 0) {chr = *ptr++; } + } + if (delta == 0) {chr = *ptr++; } write_quoted(chr, qt, stream); - } while (TRUE); + } while (true); wrputc(qt, stream); } @@ -1259,7 +1261,7 @@ char *Yap_TermToString(Term t, size_t *lengthp, encoding_t enc, int flags) { int sno = Yap_open_buf_write_stream(enc, flags); const char *sf; DBTerm *e = LOCAL_BallTerm; - + if (sno < 0) return NULL; LOCAL_c_output_stream = sno; diff --git a/C/yap-args.c b/C/yap-args.c index 27af5bdce..7ec1cc274 100755 --- a/C/yap-args.c +++ b/C/yap-args.c @@ -369,8 +369,7 @@ X_API YAP_file_type_t YAP_parse_yap_arguments(int argc, char *argv[], p++; } } else { - YAP_SetOutputMessage(); - + YAP_SetOutputMessage(); } break; #endif @@ -446,13 +445,13 @@ X_API YAP_file_type_t YAP_parse_yap_arguments(int argc, char *argv[], break; case 'n': if (!strcmp("nosignals", p)) { - iap->PrologShouldHandleInterrupts = FALSE; + iap->PrologCannotHandleInterrupts = true; break; } break; case '-': if (!strcmp("-nosignals", p)) { - iap->PrologShouldHandleInterrupts = FALSE; + iap->PrologCannotHandleInterrupts = true; break; } else if (!strncmp("-home=", p, strlen("-home="))) { GLOBAL_Home = p + strlen("-home="); diff --git a/CMakeLists.txt b/CMakeLists.txt index 5589a888f..aef88b428 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,7 @@ -# Sets the minimum version of CMake required to build the native -# library. You should either keep the default value or only pass a # value of 3.4.0 or lower. -# Sets the minimum version of CMake required to build the native -# library. You should either keep the default value or only pass a +# Sets the version of CMake required to build the native +# library. You should either keep the default value or pass a # value of 3.4.0 or lower. project( YAP ) @@ -15,14 +13,13 @@ if (ANDROID) else () cmake_minimum_required(VERSION 2.8) include(CMakeToolsHelpers OPTIONAL) - - endif() set( - CMAKE_MODULE_PATH - "${CMAKE_SOURCE_DIR}" - "${CMAKE_SOURCE_DIR}/cmake") + CMAKE_MODULE_PATH + "${CMAKE_SOURCE_DIR}" + "${CMAKE_SOURCE_DIR}/cmake" + ) include(CheckIncludeFiles) include(CheckLibraryExists) @@ -34,14 +31,15 @@ include(MacroOptionalFindPackage) include(MacroLogFeature) include(FindPackageHandleStandardArgs) include (GNUInstallDirs) + # Creates and names a library, sets it as either STATIC -# or SHARED, and provides the relative paths to its source code. -# You can define multiple libraries, and CMake builds it for you. +# or SHARED, and provides the relative paths to its source code.z +# You can define libraries, and CMake builds it for you. # Gradle automatically packages shared libraries with your APK. #cross-compilation support # Search packages for host system instead of packages for target system -# in case of cross compilation these macro should be defined by toolchain file +# in case of cross compilation define these macro by toolchain file if(NOT COMMAND find_host_package) macro(find_host_package) find_package(${ARGN}) @@ -54,6 +52,8 @@ if(NOT COMMAND find_host_program) endif() option(BUILD_SHARED_LIBS "Build shared library" ON) +set (CMAKE_POSITION_INDEPENDENT_CODE TRUE) +set (CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) include(Prelims NO_POLICY_SCOPE) @@ -61,15 +61,17 @@ include(Sources NO_POLICY_SCOPE) include(Model NO_POLICY_SCOPE) -include_directories ( utf8proc packages/myddas packages/myddas/sqlite3) +include_directories ( utf8proc packages/myddas packages/myddas/sqlite3/src) if (ANDROID) include_directories ( - packages/myddas/sqlite3/Android/jni/sqlite - packages/myddas/sqlite3/Android/jni/sqlite/nativehelper + packages/myddas/sqlite3/src/Android/jni/sqlite + packages/myddas/sqlite3/src/Android/jni/sqlite/nativehelper ) endif (ANDROID) + set_property( SOURCE ${LIBYAP_SOURCES} APPEND PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1) + add_definitions(-DUSE_MYDDAS=1 -DMYDDAS_SQLITE3=1) if (MYSQL_FOUND) @@ -83,37 +85,33 @@ if (ODBC_FOUND) if (MYSQL_POSTGRES) add_definitions(= -DMYDDAS_POSTGRES=1) endif() + if (MYSQL_POSTGRES) + set(SWIG_SOURCES packages/swig/python/yap_PYTHONwrapper.cxx ) + endif() -if (ANDROID) + + if (ANDROID) ADD_SUBDIRECTORY(os) ADD_SUBDIRECTORY(OPTYap) ADD_SUBDIRECTORY(packages/myddas) - ADD_SUBDIRECTORY(library/random) - ADD_SUBDIRECTORY(library/system) ADD_SUBDIRECTORY(utf8proc) ADD_SUBDIRECTORY(CXX) -set (SWIG_FILES ${CMAKE_SOURCE_DIR}/../generated/jni/yap_wrap.cpp ) -else () - set(YLIBS - $ - $ - $ - $ - $ - $ - ) - - -endif () +else() + List (APPEND YLIBS $ ) + List (APPEND YLIBS $ ) + List (APPEND YLIBS $ ) + List (APPEND YLIBS $ ) + List (APPEND YLIBS $ ) + List (APPEND YLIBS $ ) if (WIN32) - list (APPEND YLIBS $) - + List (APPEND YLIBS $ ) endif() + add_library( # Sets the name of the library. libYap @@ -121,22 +119,24 @@ add_library( # Sets the name of the library. SHARED ${ENGINE_SOURCES} - ${SWIG_FILES} ${C_INTERFACE_SOURCES} - ${STATIC_SOURCES} - ${ALL_SOURCES} + //${STATIC_SOURCES} + # cmake object libraries ${YLIBS} - ${WINDLLS} ) +if (WIN32) + target_link_libraries(libYap ${WINDLLS}) +endif (WIN32) + include(libYap NO_POLICY_SCOPE) +endif() if (USE_READLINE) target_link_libraries(libYap ${READLINE_LIBRARIES}) endif (USE_READLINE) - if (ANDROID) add_dependencies(libYap plmyddas ) @@ -145,9 +145,8 @@ if (ANDROID) endif () set_target_properties(libYap - PROPERTIES OUTPUT_NAME Yap - ) - + PROPERTIES OUTPUT_NAME Yap + ) MY_include(Packages NO_POLICY_SCOPE) - include(Config NO_POLICY_SCOPE) +include(Config NO_POLICY_SCOPE) diff --git a/CXX/CMakeLists.txt b/CXX/CMakeLists.txt index 105fbb8e6..4d2c8a390 100644 --- a/CXX/CMakeLists.txt +++ b/CXX/CMakeLists.txt @@ -8,18 +8,29 @@ set (CXX_SOURCES yapi.cpp ) +set (CXX_HEADERS + yapa.hh + yapdb.hh + yapi.h + yapie.hh + yapq.hh +- yapt.hh +-) list(APPEND LIBYAP_SOURCES ${CXX_SOURCES} PARENT_SCOPE) -if (ANDROID OR WIN32) - add_component (Yap++ ${CXX_SOURCES} ) -else() - add_external (Yap++ ${CXX_SOURCES} ) - MY_target_link_libraries(Yap++ ${CMAKE_DL_LIBS} libYap) +if ( WIN32) + add_component (YAP++ ${CXX_SOURCES} ) - MY_install(TARGETS Yap++ - LIBRARY DESTINATION ${libdir} - ARCHIVE DESTINATION ${libdir} + set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "_YAP_NOT_INSTALLED_=1;HAVE_CONFIG_H=1;_GNU_SOURCE;YAP_KERNEL=1" ) +else() + add_external (YAP++ ${CXX_SOURCES} ) + MY_target_link_libraries(YAP++ ${CMAKE_DL_LIBS} libYap) + + MY_install(TARGETS YAP++ + LIBRARY DESTINATION ${dlls} + RUNTIME DESTINATION ${dlls} + ARCHIVE DESTINATION ${dlls} ) endif() diff --git a/CXX/CXXSources.cmake b/CXX/CXXSources.cmake index 52dec53fa..e69de29bb 100644 --- a/CXX/CXXSources.cmake +++ b/CXX/CXXSources.cmake @@ -1,9 +0,0 @@ -set (CXX_SOURCES - yapa.hh - yapdb.hh - yapi.cpp - yapi.hh - yapie.hh - yapq.hh - yapt.hh -) diff --git a/CXX/_yap/__init__.c b/CXX/_yap/__init__.c deleted file mode 100644 index b0063debf..000000000 --- a/CXX/_yap/__init__.c +++ /dev/null @@ -1,1684 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE___yap____init__ -#define __PYX_HAVE_API___yap____init__ -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_yap/__init__.py", -}; - -/*--- Type declarations ---*/ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* SetPackagePathFromImportLib.proto */ -#if PY_VERSION_HEX >= 0x03030000 -static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, PyObject *module_name); -#else -#define __Pyx_SetPackagePathFromImportLib(a, b) 0 -#endif - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from '_yap.__init__' */ -#define __Pyx_MODULE_NAME "_yap.__init__" -int __pyx_module_is_main__yap____init__ = 0; - -/* Implementation of '_yap.__init__' */ -static const char __pyx_k_yap[] = "_yap"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_test[] = "__test__"; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_u_yap; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "_yap", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_u_yap, __pyx_k_yap, sizeof(__pyx_k_yap), 0, 1, 0, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC init_yap(void); /*proto*/ -PyMODINIT_FUNC init_yap(void) -#else -PyMODINIT_FUNC PyInit__yap(void); /*proto*/ -PyMODINIT_FUNC PyInit__yap(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__yap(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("_yap", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main__yap____init__) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - if (unlikely(__Pyx_SetPackagePathFromImportLib(NULL, __pyx_n_u_yap) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "_yap")) { - if (unlikely(PyDict_SetItemString(modules, "_yap", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "_yap/__init__.py":1 - # <<<<<<<<<<<<<< - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init _yap.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init _yap.__init__"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* SetPackagePathFromImportLib */ -#if PY_VERSION_HEX >= 0x03030000 -static int __Pyx_SetPackagePathFromImportLib(const char* parent_package_name, PyObject *module_name) { - PyObject *importlib, *loader, *osmod, *ossep, *parts, *package_path; - PyObject *path = NULL, *file_path = NULL; - int result; - if (parent_package_name) { - PyObject *package = PyImport_ImportModule(parent_package_name); - if (unlikely(!package)) - goto bad; - path = PyObject_GetAttrString(package, "__path__"); - Py_DECREF(package); - if (unlikely(!path) || unlikely(path == Py_None)) - goto bad; - } else { - path = Py_None; Py_INCREF(Py_None); - } - importlib = PyImport_ImportModule("importlib"); - if (unlikely(!importlib)) - goto bad; - loader = PyObject_CallMethod(importlib, "find_loader", "(OO)", module_name, path); - Py_DECREF(importlib); - Py_DECREF(path); path = NULL; - if (unlikely(!loader)) - goto bad; - file_path = PyObject_GetAttrString(loader, "path"); - Py_DECREF(loader); - if (unlikely(!file_path)) - goto bad; - if (unlikely(PyObject_SetAttrString(__pyx_m, "__file__", file_path) < 0)) - goto bad; - osmod = PyImport_ImportModule("os"); - if (unlikely(!osmod)) - goto bad; - ossep = PyObject_GetAttrString(osmod, "sep"); - Py_DECREF(osmod); - if (unlikely(!ossep)) - goto bad; - parts = PyObject_CallMethod(file_path, "rsplit", "(Oi)", ossep, 1); - Py_DECREF(file_path); file_path = NULL; - Py_DECREF(ossep); - if (unlikely(!parts)) - goto bad; - package_path = Py_BuildValue("[O]", PyList_GET_ITEM(parts, 0)); - Py_DECREF(parts); - if (unlikely(!package_path)) - goto bad; - goto set_path; -bad: - PyErr_WriteUnraisable(module_name); - Py_XDECREF(path); - Py_XDECREF(file_path); - PyErr_Clear(); - package_path = PyList_New(0); - if (unlikely(!package_path)) - return -1; -set_path: - result = PyObject_SetAttrString(__pyx_m, "__path__", package_path); - Py_DECREF(package_path); - return result; -} -#endif - -/* CodeObjectCache */ -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/dtypes.c b/CXX/_yap/dtypes.c deleted file mode 100644 index 4944d0cef..000000000 --- a/CXX/_yap/dtypes.c +++ /dev/null @@ -1,5233 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE___yap__dtypes -#define __PYX_HAVE_API___yap__dtypes -#include "string.h" -#include "stdio.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#include "xdress_extra_types.h" -#include "structmember.h" -#include "ios" -#include "new" -#include "stdexcept" -#include "typeinfo" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* None.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - - -static const char *__pyx_f[] = { - "__init__.pxd", - "_yap/dtypes.pyx", - "type.pxd", -}; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -/* "xdress_extra_types.pxd":14 - * cdef void emit_endif "#endif //" () - * - * ctypedef unsigned char uchar # <<<<<<<<<<<<<< - * ctypedef long long int64 - * ctypedef unsigned short uint16 - */ -typedef unsigned char __pyx_t_4_yap_18xdress_extra_types_uchar; - -/* "xdress_extra_types.pxd":15 - * - * ctypedef unsigned char uchar - * ctypedef long long int64 # <<<<<<<<<<<<<< - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - */ -typedef PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_int64; - -/* "xdress_extra_types.pxd":16 - * ctypedef unsigned char uchar - * ctypedef long long int64 - * ctypedef unsigned short uint16 # <<<<<<<<<<<<<< - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - */ -typedef unsigned short __pyx_t_4_yap_18xdress_extra_types_uint16; - -/* "xdress_extra_types.pxd":17 - * ctypedef long long int64 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 # <<<<<<<<<<<<<< - * ctypedef unsigned long long uint64 - * ctypedef long double float128 - */ -typedef unsigned int __pyx_t_4_yap_18xdress_extra_types_uint32; - -/* "xdress_extra_types.pxd":18 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 # <<<<<<<<<<<<<< - * ctypedef long double float128 - * - */ -typedef unsigned PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_uint64; - -/* "xdress_extra_types.pxd":19 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - * ctypedef long double float128 # <<<<<<<<<<<<<< - * - * cdef extern from "xdress_extra_types.h": - */ -typedef long double __pyx_t_4_yap_18xdress_extra_types_float128; -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - - -/*--- Type declarations ---*/ - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -/* ModuleImport.proto */ -static PyObject *__Pyx_ImportModule(const char *name); - -/* TypeImport.proto */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from 'libc' */ - -/* Module declarations from 'cpython.version' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from '_yap.xdress_extra_types' */ - -/* Module declarations from '_yap.dtypes' */ -#define __Pyx_MODULE_NAME "_yap.dtypes" -int __pyx_module_is_main__yap__dtypes = 0; - -/* Implementation of '_yap.dtypes' */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_dtypes[] = "dtypes"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_basestring[] = "basestring"; -static const char __pyx_k_collections[] = "collections"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; -static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_basestring; -static PyObject *__pyx_n_s_collections; -static PyObject *__pyx_n_s_dtypes; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 218, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 222, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * - */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 259, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 278, __pyx_L1_error) - break; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(0, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 796, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 799, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L7_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 803, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 823, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(0, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) - */ - /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr - */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * - */ - Py_XDECREF(__pyx_v_arr->base); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "dtypes", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_dtypes, __pyx_k_dtypes, sizeof(__pyx_k_dtypes), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 231, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 799, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initdtypes(void); /*proto*/ -PyMODINIT_FUNC initdtypes(void) -#else -PyMODINIT_FUNC PyInit_dtypes(void); /*proto*/ -PyMODINIT_FUNC PyInit_dtypes(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_dtypes(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("dtypes", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main__yap__dtypes) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "_yap.dtypes")) { - if (unlikely(PyDict_SetItemString(modules, "_yap.dtypes", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(0, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - - /* "_yap/dtypes.pyx":17 - * - * # Python Imports - * import collections # <<<<<<<<<<<<<< - * - * cimport numpy as np - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(1, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "_yap/dtypes.pyx":20 - * - * cimport numpy as np - * import numpy as np # <<<<<<<<<<<<<< - * np.import_array() - * - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "_yap/dtypes.pyx":21 - * cimport numpy as np - * import numpy as np - * np.import_array() # <<<<<<<<<<<<<< - * - * cimport xdress_extra_types - */ - import_array(); - - /* "_yap/dtypes.pyx":31 - * - * - * dtypes = {} # <<<<<<<<<<<<<< - * - * if PY_MAJOR_VERSION >= 3: - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtypes, __pyx_t_1) < 0) __PYX_ERR(1, 31, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "_yap/dtypes.pyx":33 - * dtypes = {} - * - * if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< - * basestring = str - * - */ - __pyx_t_2 = ((PY_MAJOR_VERSION >= 3) != 0); - if (__pyx_t_2) { - - /* "_yap/dtypes.pyx":34 - * - * if PY_MAJOR_VERSION >= 3: - * basestring = str # <<<<<<<<<<<<<< - * - * # Dirty ifdef, else, else preprocessor hack - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(1, 34, __pyx_L1_error) - - /* "_yap/dtypes.pyx":33 - * dtypes = {} - * - * if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< - * basestring = str - * - */ - } - - /* "_yap/dtypes.pyx":1 - * ################### # <<<<<<<<<<<<<< - * ### WARNING!!! ### - * ################### - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init _yap.dtypes", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init _yap.dtypes"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); - case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); - case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_absf(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); - case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); - case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_abs(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/dtypes.pxd b/CXX/_yap/dtypes.pxd deleted file mode 100644 index 8beaf9a2d..000000000 --- a/CXX/_yap/dtypes.pxd +++ /dev/null @@ -1,142 +0,0 @@ -################### -### WARNING!!! ### -################### -# This file has been autogenerated - -# Cython imports -from cython.operator cimport dereference as deref -from cython.operator cimport preincrement as inc -from libc cimport stdio -from cpython.version cimport PY_MAJOR_VERSION -from cpython.ref cimport PyTypeObject, Py_INCREF, Py_XDECREF -from cpython.type cimport PyType_Ready -from cpython.object cimport PyObject -from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE - -# Python imports -cimport numpy as np - -# Local imports -cimport xdress_extra_types - -# Cython imports for types - - -cdef extern from "Python.h": - ctypedef Py_ssize_t Py_ssize_t - - cdef long Py_TPFLAGS_DEFAULT - cdef long Py_TPFLAGS_BASETYPE - cdef long Py_TPFLAGS_CHECKTYPES - cdef long Py_TPFLAGS_HEAPTYPE - - ctypedef struct PyGetSetDef: - char * name - - ctypedef struct PyTypeObject: - char * tp_name - int tp_basicsize - int tp_itemsize - object tp_alloc(PyTypeObject *, Py_ssize_t) - void tp_dealloc(object) - object tp_richcompare(object, object, int) - object tp_new(PyTypeObject *, object, object) - object tp_str(object) - object tp_repr(object) - long tp_hash(object) - long tp_flags - char * tp_doc - PyMemberDef * tp_members - PyGetSetDef * tp_getset - PyTypeObject * tp_base - void tp_free(void *) - # This is a dirty hack by declaring to Cython both the Python 2 & 3 APIs - int (*tp_compare)(object, object) # Python 2 - void * (*tp_reserved)(object, object) # Python 3 - -# structmember.h isn't included in Python.h for some reason -cdef extern from "structmember.h": - ctypedef struct PyMemberDef: - char * name - int type - Py_ssize_t offset - int flags - char * doc - -cdef extern from "numpy/arrayobject.h": - - ctypedef object (*PyArray_GetItemFunc)(void *, void *) - ctypedef int (*PyArray_SetItemFunc)(object, void *, void *) - ctypedef void (*PyArray_CopySwapNFunc)(void *, np.npy_intp, void *, np.npy_intp, np.npy_intp, int, void *) - ctypedef void (*PyArray_CopySwapFunc)(void *, void *, int, void *) - ctypedef int (*PyArray_CompareFunc)(const void* d1, const void *, void *) - ctypedef int (*PyArray_ArgFunc)(void *, np.npy_intp, np.npy_intp *, void *) - ctypedef void (*PyArray_DotFunc)(void *, np.npy_intp, void *, np.npy_intp, void *, np.npy_intp, void *) - ctypedef int (*PyArray_ScanFunc)(stdio.FILE *, void *, void *, void *) - ctypedef int (*PyArray_FromStrFunc)(char *, void *, char **, void *) - ctypedef np.npy_bool (*PyArray_NonzeroFunc)(void *, void *) - ctypedef void (*PyArray_FillFunc)(void *, np.npy_intp, void *) - ctypedef void (*PyArray_FillWithScalarFunc)(void *, np.npy_intp, void *, void *) - ctypedef int (*PyArray_SortFunc)(void *, np.npy_intp, void *) - ctypedef int (*PyArray_ArgSortFunc)(void *, np.npy_intp *, np.npy_intp, void *) - ctypedef np.NPY_SCALARKIND (*PyArray_ScalarKindFunc)(np.PyArrayObject *) - - ctypedef struct PyArray_ArrFuncs: - np.PyArray_VectorUnaryFunc ** cast - PyArray_GetItemFunc *getitem - PyArray_SetItemFunc *setitem - PyArray_CopySwapNFunc *copyswapn - PyArray_CopySwapFunc *copyswap - PyArray_CompareFunc *compare - PyArray_ArgFunc *argmax - PyArray_DotFunc *dotfunc - PyArray_ScanFunc *scanfunc - PyArray_FromStrFunc *fromstr - PyArray_NonzeroFunc *nonzero - PyArray_FillFunc *fill - PyArray_FillWithScalarFunc *fillwithscalar - PyArray_SortFunc *sort - PyArray_ArgSortFunc *argsort - PyObject *castdict - PyArray_ScalarKindFunc *scalarkind - int **cancastscalarkindto - int *cancastto - int listpickle - - cdef void PyArray_InitArrFuncs(PyArray_ArrFuncs *) - - ctypedef struct PyArray_ArrayDescr: - PyArray_Descr * base - PyObject *shape - - cdef void ** PyArray_API - - cdef PyTypeObject * PyArrayDescr_Type - - ctypedef struct PyArray_Descr: - Py_ssize_t ob_refcnt - PyTypeObject * ob_type - PyTypeObject * typeobj - char kind - char type - char byteorder - int flags - int type_num - int elsize - int alignment - PyArray_ArrayDescr * subarray - PyObject * fields - PyObject * names - PyArray_ArrFuncs * f - - cdef int PyArray_RegisterDataType(PyArray_Descr *) - - cdef object PyArray_Scalar(void *, PyArray_Descr *, object) - -cdef extern from "xdress_extra_types.h" namespace "xdress_extra_types": - cdef cppclass MemoryKnight[T]: - MemoryKnight() nogil except + - T * defnew() nogil except + - T * renew(void *) nogil except + - void deall(T *) nogil except + - diff --git a/CXX/_yap/dtypes.pyx b/CXX/_yap/dtypes.pyx deleted file mode 100644 index 75fce8085..000000000 --- a/CXX/_yap/dtypes.pyx +++ /dev/null @@ -1,43 +0,0 @@ -################### -### WARNING!!! ### -################### -# This file has been autogenerated - -# Cython imports -from cython.operator cimport dereference as deref -from cython.operator cimport preincrement as inc -from libc.stdlib cimport malloc, free -from libc.string cimport memcpy -from cpython.version cimport PY_MAJOR_VERSION -from cpython.ref cimport PyTypeObject -from cpython.type cimport PyType_Ready -from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE - -# Python Imports -import collections - -cimport numpy as np -import numpy as np -np.import_array() - -cimport xdress_extra_types - -# Cython imports for types - - -# imports for types - - -dtypes = {} - -if PY_MAJOR_VERSION >= 3: - basestring = str - -# Dirty ifdef, else, else preprocessor hack -# see http://comments.gmane.org/gmane.comp.python.cython.user/4080 -cdef extern from *: - cdef void emit_ifpy2k "#if PY_MAJOR_VERSION == 2 //" () - cdef void emit_ifpy3k "#if PY_MAJOR_VERSION == 3 //" () - cdef void emit_else "#else //" () - cdef void emit_endif "#endif //" () - diff --git a/CXX/_yap/stlcontainers.c b/CXX/_yap/stlcontainers.c deleted file mode 100644 index 4446ac2fa..000000000 --- a/CXX/_yap/stlcontainers.c +++ /dev/null @@ -1,5234 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE___yap__stlcontainers -#define __PYX_HAVE_API___yap__stlcontainers -#include "string.h" -#include -#include "ios" -#include "new" -#include "stdexcept" -#include "typeinfo" -#include -#include -#include -#include -#include "stdio.h" -#include "stdlib.h" -#include "numpy/arrayobject.h" -#include "numpy/ufuncobject.h" -#include "xdress_extra_types.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - -/* None.proto */ -#if !defined(CYTHON_CCOMPLEX) - #if defined(__cplusplus) - #define CYTHON_CCOMPLEX 1 - #elif defined(_Complex_I) - #define CYTHON_CCOMPLEX 1 - #else - #define CYTHON_CCOMPLEX 0 - #endif -#endif -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #include - #else - #include - #endif -#endif -#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) - #undef _Complex_I - #define _Complex_I 1.0fj -#endif - - -static const char *__pyx_f[] = { - "__init__.pxd", - "_yap/stlcontainers.pyx", - "type.pxd", -}; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":725 - * # in Cython to enable them only on the right systems. - * - * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - */ -typedef npy_int8 __pyx_t_5numpy_int8_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":726 - * - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t - */ -typedef npy_int16 __pyx_t_5numpy_int16_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":727 - * ctypedef npy_int8 int8_t - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< - * ctypedef npy_int64 int64_t - * #ctypedef npy_int96 int96_t - */ -typedef npy_int32 __pyx_t_5numpy_int32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":728 - * ctypedef npy_int16 int16_t - * ctypedef npy_int32 int32_t - * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< - * #ctypedef npy_int96 int96_t - * #ctypedef npy_int128 int128_t - */ -typedef npy_int64 __pyx_t_5numpy_int64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":732 - * #ctypedef npy_int128 int128_t - * - * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - */ -typedef npy_uint8 __pyx_t_5numpy_uint8_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":733 - * - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t - */ -typedef npy_uint16 __pyx_t_5numpy_uint16_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":734 - * ctypedef npy_uint8 uint8_t - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< - * ctypedef npy_uint64 uint64_t - * #ctypedef npy_uint96 uint96_t - */ -typedef npy_uint32 __pyx_t_5numpy_uint32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":735 - * ctypedef npy_uint16 uint16_t - * ctypedef npy_uint32 uint32_t - * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< - * #ctypedef npy_uint96 uint96_t - * #ctypedef npy_uint128 uint128_t - */ -typedef npy_uint64 __pyx_t_5numpy_uint64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":739 - * #ctypedef npy_uint128 uint128_t - * - * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< - * ctypedef npy_float64 float64_t - * #ctypedef npy_float80 float80_t - */ -typedef npy_float32 __pyx_t_5numpy_float32_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":740 - * - * ctypedef npy_float32 float32_t - * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< - * #ctypedef npy_float80 float80_t - * #ctypedef npy_float128 float128_t - */ -typedef npy_float64 __pyx_t_5numpy_float64_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":749 - * # The int types are mapped a bit surprising -- - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t - */ -typedef npy_long __pyx_t_5numpy_int_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":750 - * # numpy.int corresponds to 'l' and numpy.long to 'q' - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< - * ctypedef npy_longlong longlong_t - * - */ -typedef npy_longlong __pyx_t_5numpy_long_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":751 - * ctypedef npy_long int_t - * ctypedef npy_longlong long_t - * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_ulong uint_t - */ -typedef npy_longlong __pyx_t_5numpy_longlong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":753 - * ctypedef npy_longlong longlong_t - * - * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t - */ -typedef npy_ulong __pyx_t_5numpy_uint_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":754 - * - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< - * ctypedef npy_ulonglong ulonglong_t - * - */ -typedef npy_ulonglong __pyx_t_5numpy_ulong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":755 - * ctypedef npy_ulong uint_t - * ctypedef npy_ulonglong ulong_t - * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< - * - * ctypedef npy_intp intp_t - */ -typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":757 - * ctypedef npy_ulonglong ulonglong_t - * - * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< - * ctypedef npy_uintp uintp_t - * - */ -typedef npy_intp __pyx_t_5numpy_intp_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":758 - * - * ctypedef npy_intp intp_t - * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< - * - * ctypedef npy_double float_t - */ -typedef npy_uintp __pyx_t_5numpy_uintp_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":760 - * ctypedef npy_uintp uintp_t - * - * ctypedef npy_double float_t # <<<<<<<<<<<<<< - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t - */ -typedef npy_double __pyx_t_5numpy_float_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":761 - * - * ctypedef npy_double float_t - * ctypedef npy_double double_t # <<<<<<<<<<<<<< - * ctypedef npy_longdouble longdouble_t - * - */ -typedef npy_double __pyx_t_5numpy_double_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":762 - * ctypedef npy_double float_t - * ctypedef npy_double double_t - * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cfloat cfloat_t - */ -typedef npy_longdouble __pyx_t_5numpy_longdouble_t; - -/* "xdress_extra_types.pxd":14 - * cdef void emit_endif "#endif //" () - * - * ctypedef unsigned char uchar # <<<<<<<<<<<<<< - * ctypedef long long int64 - * ctypedef unsigned short uint16 - */ -typedef unsigned char __pyx_t_4_yap_18xdress_extra_types_uchar; - -/* "xdress_extra_types.pxd":15 - * - * ctypedef unsigned char uchar - * ctypedef long long int64 # <<<<<<<<<<<<<< - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - */ -typedef PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_int64; - -/* "xdress_extra_types.pxd":16 - * ctypedef unsigned char uchar - * ctypedef long long int64 - * ctypedef unsigned short uint16 # <<<<<<<<<<<<<< - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - */ -typedef unsigned short __pyx_t_4_yap_18xdress_extra_types_uint16; - -/* "xdress_extra_types.pxd":17 - * ctypedef long long int64 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 # <<<<<<<<<<<<<< - * ctypedef unsigned long long uint64 - * ctypedef long double float128 - */ -typedef unsigned int __pyx_t_4_yap_18xdress_extra_types_uint32; - -/* "xdress_extra_types.pxd":18 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 # <<<<<<<<<<<<<< - * ctypedef long double float128 - * - */ -typedef unsigned PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_uint64; - -/* "xdress_extra_types.pxd":19 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - * ctypedef long double float128 # <<<<<<<<<<<<<< - * - * cdef extern from "xdress_extra_types.h": - */ -typedef long double __pyx_t_4_yap_18xdress_extra_types_float128; -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< float > __pyx_t_float_complex; - #else - typedef float _Complex __pyx_t_float_complex; - #endif -#else - typedef struct { float real, imag; } __pyx_t_float_complex; -#endif - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - typedef ::std::complex< double > __pyx_t_double_complex; - #else - typedef double _Complex __pyx_t_double_complex; - #endif -#else - typedef struct { double real, imag; } __pyx_t_double_complex; -#endif - - -/*--- Type declarations ---*/ - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":764 - * ctypedef npy_longdouble longdouble_t - * - * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t - */ -typedef npy_cfloat __pyx_t_5numpy_cfloat_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":765 - * - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< - * ctypedef npy_clongdouble clongdouble_t - * - */ -typedef npy_cdouble __pyx_t_5numpy_cdouble_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":766 - * ctypedef npy_cfloat cfloat_t - * ctypedef npy_cdouble cdouble_t - * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< - * - * ctypedef npy_cdouble complex_t - */ -typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":768 - * ctypedef npy_clongdouble clongdouble_t - * - * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew1(a): - */ -typedef npy_cdouble __pyx_t_5numpy_complex_t; - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* RaiseException.proto */ -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); - -/* DictGetItem.proto */ -#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY -static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) { - PyObject *value; - value = PyDict_GetItemWithError(d, key); - if (unlikely(!value)) { - if (!PyErr_Occurred()) { - PyObject* args = PyTuple_Pack(1, key); - if (likely(args)) - PyErr_SetObject(PyExc_KeyError, args); - Py_XDECREF(args); - } - return NULL; - } - Py_INCREF(value); - return value; -} -#else - #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key) -#endif - -/* RaiseTooManyValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); - -/* RaiseNeedMoreValuesToUnpack.proto */ -static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); - -/* RaiseNoneIterError.proto */ -static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); - -/* ExtTypeTest.proto */ -static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #ifdef __cplusplus - #define __Pyx_CREAL(z) ((z).real()) - #define __Pyx_CIMAG(z) ((z).imag()) - #else - #define __Pyx_CREAL(z) (__real__(z)) - #define __Pyx_CIMAG(z) (__imag__(z)) - #endif -#else - #define __Pyx_CREAL(z) ((z).real) - #define __Pyx_CIMAG(z) ((z).imag) -#endif -#if defined(__cplusplus) && CYTHON_CCOMPLEX && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103) - #define __Pyx_SET_CREAL(z,x) ((z).real(x)) - #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) -#else - #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) - #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eqf(a, b) ((a)==(b)) - #define __Pyx_c_sumf(a, b) ((a)+(b)) - #define __Pyx_c_difff(a, b) ((a)-(b)) - #define __Pyx_c_prodf(a, b) ((a)*(b)) - #define __Pyx_c_quotf(a, b) ((a)/(b)) - #define __Pyx_c_negf(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zerof(z) ((z)==(float)0) - #define __Pyx_c_conjf(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_absf(z) (::std::abs(z)) - #define __Pyx_c_powf(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zerof(z) ((z)==0) - #define __Pyx_c_conjf(z) (conjf(z)) - #if 1 - #define __Pyx_c_absf(z) (cabsf(z)) - #define __Pyx_c_powf(a, b) (cpowf(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); - #endif -#endif - -/* None.proto */ -static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); - -/* None.proto */ -#if CYTHON_CCOMPLEX - #define __Pyx_c_eq(a, b) ((a)==(b)) - #define __Pyx_c_sum(a, b) ((a)+(b)) - #define __Pyx_c_diff(a, b) ((a)-(b)) - #define __Pyx_c_prod(a, b) ((a)*(b)) - #define __Pyx_c_quot(a, b) ((a)/(b)) - #define __Pyx_c_neg(a) (-(a)) - #ifdef __cplusplus - #define __Pyx_c_is_zero(z) ((z)==(double)0) - #define __Pyx_c_conj(z) (::std::conj(z)) - #if 1 - #define __Pyx_c_abs(z) (::std::abs(z)) - #define __Pyx_c_pow(a, b) (::std::pow(a, b)) - #endif - #else - #define __Pyx_c_is_zero(z) ((z)==0) - #define __Pyx_c_conj(z) (conj(z)) - #if 1 - #define __Pyx_c_abs(z) (cabs(z)) - #define __Pyx_c_pow(a, b) (cpow(a, b)) - #endif - #endif -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); - #endif -#endif - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* PyIdentifierFromString.proto */ -#if !defined(__Pyx_PyIdentifier_FromString) -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) -#else - #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) -#endif -#endif - -/* ModuleImport.proto */ -static PyObject *__Pyx_ImportModule(const char *name); - -/* TypeImport.proto */ -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libcpp.string' */ - -/* Module declarations from 'libcpp.utility' */ - -/* Module declarations from 'libcpp.map' */ - -/* Module declarations from 'libcpp.set' */ - -/* Module declarations from 'libcpp.vector' */ - -/* Module declarations from 'libcpp' */ - -/* Module declarations from 'libc.stdlib' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from 'libc' */ - -/* Module declarations from 'cpython.version' */ - -/* Module declarations from '__builtin__' */ - -/* Module declarations from 'cpython.type' */ -static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; - -/* Module declarations from 'cpython.buffer' */ - -/* Module declarations from 'cpython' */ - -/* Module declarations from 'cpython.object' */ - -/* Module declarations from 'cpython.ref' */ - -/* Module declarations from 'numpy' */ - -/* Module declarations from 'numpy' */ -static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; -static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; -static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; -static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; -static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ - -/* Module declarations from '_yap.xdress_extra_types' */ - -/* Module declarations from '_yap.stlcontainers' */ -#define __Pyx_MODULE_NAME "_yap.stlcontainers" -int __pyx_module_is_main__yap__stlcontainers = 0; - -/* Implementation of '_yap.stlcontainers' */ -static PyObject *__pyx_builtin_ValueError; -static PyObject *__pyx_builtin_range; -static PyObject *__pyx_builtin_RuntimeError; -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_range[] = "range"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_ValueError[] = "ValueError"; -static const char __pyx_k_basestring[] = "basestring"; -static const char __pyx_k_collections[] = "collections"; -static const char __pyx_k_RuntimeError[] = "RuntimeError"; -static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; -static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; -static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; -static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; -static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; -static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; -static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; -static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; -static PyObject *__pyx_n_s_RuntimeError; -static PyObject *__pyx_n_s_ValueError; -static PyObject *__pyx_n_s_basestring; -static PyObject *__pyx_n_s_collections; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; -static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_range; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ -static PyObject *__pyx_tuple_; -static PyObject *__pyx_tuple__2; -static PyObject *__pyx_tuple__3; -static PyObject *__pyx_tuple__4; -static PyObject *__pyx_tuple__5; -static PyObject *__pyx_tuple__6; - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - -/* Python wrapper */ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ -static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_r; - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); - __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { - int __pyx_v_copy_shape; - int __pyx_v_i; - int __pyx_v_ndim; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - int __pyx_v_t; - char *__pyx_v_f; - PyArray_Descr *__pyx_v_descr = 0; - int __pyx_v_offset; - int __pyx_v_hasfields; - int __pyx_r; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - int __pyx_t_4; - int __pyx_t_5; - PyObject *__pyx_t_6 = NULL; - char *__pyx_t_7; - __Pyx_RefNannySetupContext("__getbuffer__", 0); - if (__pyx_v_info != NULL) { - __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(__pyx_v_info->obj); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":203 - * # of flags - * - * if info == NULL: return # <<<<<<<<<<<<<< - * - * cdef int copy_shape, i, ndim - */ - __pyx_t_1 = ((__pyx_v_info == NULL) != 0); - if (__pyx_t_1) { - __pyx_r = 0; - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":206 - * - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":207 - * cdef int copy_shape, i, ndim - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * - * ndim = PyArray_NDIM(self) - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":209 - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * - * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":212 - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * copy_shape = 1 # <<<<<<<<<<<<<< - * else: - * copy_shape = 0 - */ - __pyx_v_copy_shape = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":211 - * ndim = PyArray_NDIM(self) - * - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * copy_shape = 1 - * else: - */ - goto __pyx_L4; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":214 - * copy_shape = 1 - * else: - * copy_shape = 0 # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - */ - /*else*/ { - __pyx_v_copy_shape = 0; - } - __pyx_L4:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L6_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":217 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not C contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L6_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 218, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":216 - * copy_shape = 0 - * - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L9_bool_binop_done; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":221 - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< - * raise ValueError(u"ndarray is not Fortran contiguous") - * - */ - __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L9_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 222, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":220 - * raise ValueError(u"ndarray is not C contiguous") - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":224 - * raise ValueError(u"ndarray is not Fortran contiguous") - * - * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< - * info.ndim = ndim - * if copy_shape: - */ - __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":225 - * - * info.buf = PyArray_DATA(self) - * info.ndim = ndim # <<<<<<<<<<<<<< - * if copy_shape: - * # Allocate new buffer for strides and shape info. - */ - __pyx_v_info->ndim = __pyx_v_ndim; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - __pyx_t_1 = (__pyx_v_copy_shape != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":229 - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< - * info.shape = info.strides + ndim - * for i in range(ndim): - */ - __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":230 - * # This is allocated as one block, strides first. - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim # <<<<<<<<<<<<<< - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - */ - __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":231 - * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) - * info.shape = info.strides + ndim - * for i in range(ndim): # <<<<<<<<<<<<<< - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] - */ - __pyx_t_4 = __pyx_v_ndim; - for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) { - __pyx_v_i = __pyx_t_5; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":232 - * info.shape = info.strides + ndim - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - */ - (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":233 - * for i in range(ndim): - * info.strides[i] = PyArray_STRIDES(self)[i] - * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< - * else: - * info.strides = PyArray_STRIDES(self) - */ - (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":226 - * info.buf = PyArray_DATA(self) - * info.ndim = ndim - * if copy_shape: # <<<<<<<<<<<<<< - * # Allocate new buffer for strides and shape info. - * # This is allocated as one block, strides first. - */ - goto __pyx_L11; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":235 - * info.shape[i] = PyArray_DIMS(self)[i] - * else: - * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - */ - /*else*/ { - __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":236 - * else: - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - */ - __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); - } - __pyx_L11:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":237 - * info.strides = PyArray_STRIDES(self) - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL # <<<<<<<<<<<<<< - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) - */ - __pyx_v_info->suboffsets = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":238 - * info.shape = PyArray_DIMS(self) - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< - * info.readonly = not PyArray_ISWRITEABLE(self) - * - */ - __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":239 - * info.suboffsets = NULL - * info.itemsize = PyArray_ITEMSIZE(self) - * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< - * - * cdef int t - */ - __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":242 - * - * cdef int t - * cdef char* f = NULL # <<<<<<<<<<<<<< - * cdef dtype descr = self.descr - * cdef int offset - */ - __pyx_v_f = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":243 - * cdef int t - * cdef char* f = NULL - * cdef dtype descr = self.descr # <<<<<<<<<<<<<< - * cdef int offset - * - */ - __pyx_t_3 = ((PyObject *)__pyx_v_self->descr); - __Pyx_INCREF(__pyx_t_3); - __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":246 - * cdef int offset - * - * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< - * - * if not hasfields and not copy_shape: - */ - __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L15_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L15_bool_binop_done:; - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":250 - * if not hasfields and not copy_shape: - * # do not call releasebuffer - * info.obj = None # <<<<<<<<<<<<<< - * else: - * # need to call releasebuffer - */ - __Pyx_INCREF(Py_None); - __Pyx_GIVEREF(Py_None); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = Py_None; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":248 - * cdef bint hasfields = PyDataType_HASFIELDS(descr) - * - * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< - * # do not call releasebuffer - * info.obj = None - */ - goto __pyx_L14; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":253 - * else: - * # need to call releasebuffer - * info.obj = self # <<<<<<<<<<<<<< - * - * if not hasfields: - */ - /*else*/ { - __Pyx_INCREF(((PyObject *)__pyx_v_self)); - __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); - __pyx_v_info->obj = ((PyObject *)__pyx_v_self); - } - __pyx_L14:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":256 - * - * if not hasfields: - * t = descr.type_num # <<<<<<<<<<<<<< - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - */ - __pyx_t_4 = __pyx_v_descr->type_num; - __pyx_v_t = __pyx_t_4; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0); - if (!__pyx_t_2) { - goto __pyx_L20_next_or; - } else { - } - __pyx_t_2 = (__pyx_v_little_endian != 0); - if (!__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_L20_next_or:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":258 - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - */ - __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0); - if (__pyx_t_2) { - } else { - __pyx_t_1 = __pyx_t_2; - goto __pyx_L19_bool_binop_done; - } - __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_1 = __pyx_t_2; - __pyx_L19_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 259, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":257 - * if not hasfields: - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":260 - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - */ - switch (__pyx_v_t) { - case NPY_BYTE: - __pyx_v_f = ((char *)"b"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":261 - * raise ValueError(u"Non-native byte order not supported") - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - */ - case NPY_UBYTE: - __pyx_v_f = ((char *)"B"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":262 - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - */ - case NPY_SHORT: - __pyx_v_f = ((char *)"h"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":263 - * elif t == NPY_UBYTE: f = "B" - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - */ - case NPY_USHORT: - __pyx_v_f = ((char *)"H"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":264 - * elif t == NPY_SHORT: f = "h" - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - */ - case NPY_INT: - __pyx_v_f = ((char *)"i"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":265 - * elif t == NPY_USHORT: f = "H" - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - */ - case NPY_UINT: - __pyx_v_f = ((char *)"I"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":266 - * elif t == NPY_INT: f = "i" - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - */ - case NPY_LONG: - __pyx_v_f = ((char *)"l"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":267 - * elif t == NPY_UINT: f = "I" - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - */ - case NPY_ULONG: - __pyx_v_f = ((char *)"L"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":268 - * elif t == NPY_LONG: f = "l" - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - */ - case NPY_LONGLONG: - __pyx_v_f = ((char *)"q"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":269 - * elif t == NPY_ULONG: f = "L" - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - */ - case NPY_ULONGLONG: - __pyx_v_f = ((char *)"Q"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":270 - * elif t == NPY_LONGLONG: f = "q" - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - */ - case NPY_FLOAT: - __pyx_v_f = ((char *)"f"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":271 - * elif t == NPY_ULONGLONG: f = "Q" - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - */ - case NPY_DOUBLE: - __pyx_v_f = ((char *)"d"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":272 - * elif t == NPY_FLOAT: f = "f" - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - */ - case NPY_LONGDOUBLE: - __pyx_v_f = ((char *)"g"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":273 - * elif t == NPY_DOUBLE: f = "d" - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - */ - case NPY_CFLOAT: - __pyx_v_f = ((char *)"Zf"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":274 - * elif t == NPY_LONGDOUBLE: f = "g" - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" - */ - case NPY_CDOUBLE: - __pyx_v_f = ((char *)"Zd"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":275 - * elif t == NPY_CFLOAT: f = "Zf" - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f = "O" - * else: - */ - case NPY_CLONGDOUBLE: - __pyx_v_f = ((char *)"Zg"); - break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":276 - * elif t == NPY_CDOUBLE: f = "Zd" - * elif t == NPY_CLONGDOUBLE: f = "Zg" - * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - case NPY_OBJECT: - __pyx_v_f = ((char *)"O"); - break; - default: - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":278 - * elif t == NPY_OBJECT: f = "O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * info.format = f - * return - */ - __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_GIVEREF(__pyx_t_6); - PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); - __pyx_t_6 = 0; - __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 278, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_6); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __Pyx_Raise(__pyx_t_6, 0, 0, 0); - __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0; - __PYX_ERR(0, 278, __pyx_L1_error) - break; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":279 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f # <<<<<<<<<<<<<< - * return - * else: - */ - __pyx_v_info->format = __pyx_v_f; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":280 - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * info.format = f - * return # <<<<<<<<<<<<<< - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - */ - __pyx_r = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":255 - * info.obj = self - * - * if not hasfields: # <<<<<<<<<<<<<< - * t = descr.type_num - * if ((descr.byteorder == c'>' and little_endian) or - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":282 - * return - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - */ - /*else*/ { - __pyx_v_info->format = ((char *)malloc(0xFF)); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":283 - * else: - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, - */ - (__pyx_v_info->format[0]) = '^'; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":284 - * info.format = stdlib.malloc(_buffer_format_string_len) - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 # <<<<<<<<<<<<<< - * f = _util_dtypestring(descr, info.format + 1, - * info.format + _buffer_format_string_len, - */ - __pyx_v_offset = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":285 - * info.format[0] = c'^' # Native data types, manual alignment - * offset = 0 - * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< - * info.format + _buffer_format_string_len, - * &offset) - */ - __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) __PYX_ERR(0, 285, __pyx_L1_error) - __pyx_v_f = __pyx_t_7; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":288 - * info.format + _buffer_format_string_len, - * &offset) - * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - */ - (__pyx_v_f[0]) = '\x00'; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":197 - * # experimental exception made for __getbuffer__ and __releasebuffer__ - * # -- the details of this may change. - * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< - * # This implementation of getbuffer is geared towards Cython - * # requirements, and does not yet fullfill the PEP. - */ - - /* function exit code */ - __pyx_r = 0; - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_6); - __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = -1; - if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { - __Pyx_GOTREF(__pyx_v_info->obj); - __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; - } - goto __pyx_L2; - __pyx_L0:; - if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { - __Pyx_GOTREF(Py_None); - __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; - } - __pyx_L2:; - __Pyx_XDECREF((PyObject *)__pyx_v_descr); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - -/* Python wrapper */ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ -static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); - __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("__releasebuffer__", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":292 - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) # <<<<<<<<<<<<<< - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) - */ - free(__pyx_v_info->format); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":291 - * - * def __releasebuffer__(ndarray self, Py_buffer* info): - * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":294 - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): - * stdlib.free(info.strides) # <<<<<<<<<<<<<< - * # info.shape was stored after info.strides in the same block - * - */ - free(__pyx_v_info->strides); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":293 - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< - * stdlib.free(info.strides) - * # info.shape was stored after info.strides in the same block - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":290 - * f[0] = c'\0' # Terminate format string - * - * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< - * if PyArray_HASFIELDS(self): - * stdlib.free(info.format) - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":771 - * - * cdef inline object PyArray_MultiIterNew1(a): - * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew2(a, b): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 771, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":770 - * ctypedef npy_cdouble complex_t - * - * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(1, a) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":774 - * - * cdef inline object PyArray_MultiIterNew2(a, b): - * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 774, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":773 - * return PyArray_MultiIterNew(1, a) - * - * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(2, a, b) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":777 - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): - * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":776 - * return PyArray_MultiIterNew(2, a, b) - * - * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(3, a, b, c) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":780 - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): - * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":779 - * return PyArray_MultiIterNew(3, a, b, c) - * - * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(4, a, b, c, d) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":783 - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): - * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: - */ - __Pyx_XDECREF(__pyx_r); - __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_r = __pyx_t_1; - __pyx_t_1 = 0; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":782 - * return PyArray_MultiIterNew(4, a, b, c, d) - * - * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = 0; - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - -static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { - PyArray_Descr *__pyx_v_child = 0; - int __pyx_v_endian_detector; - int __pyx_v_little_endian; - PyObject *__pyx_v_fields = 0; - PyObject *__pyx_v_childname = NULL; - PyObject *__pyx_v_new_offset = NULL; - PyObject *__pyx_v_t = NULL; - char *__pyx_r; - __Pyx_RefNannyDeclarations - PyObject *__pyx_t_1 = NULL; - Py_ssize_t __pyx_t_2; - PyObject *__pyx_t_3 = NULL; - PyObject *__pyx_t_4 = NULL; - int __pyx_t_5; - int __pyx_t_6; - int __pyx_t_7; - long __pyx_t_8; - char *__pyx_t_9; - __Pyx_RefNannySetupContext("_util_dtypestring", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":790 - * - * cdef dtype child - * cdef int endian_detector = 1 # <<<<<<<<<<<<<< - * cdef bint little_endian = ((&endian_detector)[0] != 0) - * cdef tuple fields - */ - __pyx_v_endian_detector = 1; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":791 - * cdef dtype child - * cdef int endian_detector = 1 - * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< - * cdef tuple fields - * - */ - __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - if (unlikely(__pyx_v_descr->names == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); - __PYX_ERR(0, 794, __pyx_L1_error) - } - __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; - for (;;) { - if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 794, __pyx_L1_error) - #else - __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 794, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - #endif - __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":795 - * - * for childname in descr.names: - * fields = descr.fields[childname] # <<<<<<<<<<<<<< - * child, new_offset = fields - * - */ - if (unlikely(__pyx_v_descr->fields == Py_None)) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable"); - __PYX_ERR(0, 795, __pyx_L1_error) - } - __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 795, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); - __pyx_t_3 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":796 - * for childname in descr.names: - * fields = descr.fields[childname] - * child, new_offset = fields # <<<<<<<<<<<<<< - * - * if (end - f) - (new_offset - offset[0]) < 15: - */ - if (likely(__pyx_v_fields != Py_None)) { - PyObject* sequence = __pyx_v_fields; - #if CYTHON_COMPILING_IN_CPYTHON - Py_ssize_t size = Py_SIZE(sequence); - #else - Py_ssize_t size = PySequence_Size(sequence); - #endif - if (unlikely(size != 2)) { - if (size > 2) __Pyx_RaiseTooManyValuesError(2); - else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); - __PYX_ERR(0, 796, __pyx_L1_error) - } - #if CYTHON_COMPILING_IN_CPYTHON - __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); - __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); - __Pyx_INCREF(__pyx_t_3); - __Pyx_INCREF(__pyx_t_4); - #else - __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - #endif - } else { - __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 796, __pyx_L1_error) - } - if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(0, 796, __pyx_L1_error) - __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); - __pyx_t_3 = 0; - __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 799, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":798 - * child, new_offset = fields - * - * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0); - if (!__pyx_t_7) { - goto __pyx_L8_next_or; - } else { - } - __pyx_t_7 = (__pyx_v_little_endian != 0); - if (!__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_L8_next_or:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":802 - * - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< - * raise ValueError(u"Non-native byte order not supported") - * # One could encode it in the format string and have Cython - */ - __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0); - if (__pyx_t_7) { - } else { - __pyx_t_6 = __pyx_t_7; - goto __pyx_L7_bool_binop_done; - } - __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0); - __pyx_t_6 = __pyx_t_7; - __pyx_L7_bool_binop_done:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 803, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":801 - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") - * - * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":813 - * - * # Output padding bytes - * while offset[0] < new_offset: # <<<<<<<<<<<<<< - * f[0] = 120 # "x"; pad byte - * f += 1 - */ - while (1) { - __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 813, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (!__pyx_t_6) break; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":814 - * # Output padding bytes - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< - * f += 1 - * offset[0] += 1 - */ - (__pyx_v_f[0]) = 0x78; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":815 - * while offset[0] < new_offset: - * f[0] = 120 # "x"; pad byte - * f += 1 # <<<<<<<<<<<<<< - * offset[0] += 1 - * - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":816 - * f[0] = 120 # "x"; pad byte - * f += 1 - * offset[0] += 1 # <<<<<<<<<<<<<< - * - * offset[0] += child.itemsize - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1); - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":818 - * offset[0] += 1 - * - * offset[0] += child.itemsize # <<<<<<<<<<<<<< - * - * if not PyDataType_HASFIELDS(child): - */ - __pyx_t_8 = 0; - (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":821 - * - * if not PyDataType_HASFIELDS(child): - * t = child.type_num # <<<<<<<<<<<<<< - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") - */ - __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 821, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); - __pyx_t_4 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); - if (__pyx_t_6) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_Raise(__pyx_t_4, 0, 0, 0); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __PYX_ERR(0, 823, __pyx_L1_error) - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":822 - * if not PyDataType_HASFIELDS(child): - * t = child.type_num - * if end - f < 5: # <<<<<<<<<<<<<< - * raise RuntimeError(u"Format string allocated too short.") - * - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":826 - * - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 826, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 98; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":827 - * # Until ticket #99 is fixed, use integers to avoid warnings - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 827, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":828 - * if t == NPY_BYTE: f[0] = 98 #"b" - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 828, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x68; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":829 - * elif t == NPY_UBYTE: f[0] = 66 #"B" - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 829, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 72; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":830 - * elif t == NPY_SHORT: f[0] = 104 #"h" - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 830, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x69; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":831 - * elif t == NPY_USHORT: f[0] = 72 #"H" - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 831, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 73; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":832 - * elif t == NPY_INT: f[0] = 105 #"i" - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 832, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x6C; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":833 - * elif t == NPY_UINT: f[0] = 73 #"I" - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 833, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 76; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":834 - * elif t == NPY_LONG: f[0] = 108 #"l" - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 834, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x71; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":835 - * elif t == NPY_ULONG: f[0] = 76 #"L" - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 835, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 81; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":836 - * elif t == NPY_LONGLONG: f[0] = 113 #"q" - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 836, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x66; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":837 - * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 837, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x64; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":838 - * elif t == NPY_FLOAT: f[0] = 102 #"f" - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 838, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 0x67; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":839 - * elif t == NPY_DOUBLE: f[0] = 100 #"d" - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 839, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x66; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":840 - * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 840, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x64; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":841 - * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - */ - __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 841, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 90; - (__pyx_v_f[1]) = 0x67; - __pyx_v_f = (__pyx_v_f + 1); - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":842 - * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd - * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg - * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - */ - __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 842, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - if (__pyx_t_6) { - (__pyx_v_f[0]) = 79; - goto __pyx_L15; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":844 - * elif t == NPY_OBJECT: f[0] = 79 #"O" - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< - * f += 1 - * else: - */ - /*else*/ { - __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_GIVEREF(__pyx_t_3); - PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); - __pyx_t_3 = 0; - __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 844, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_Raise(__pyx_t_3, 0, 0, 0); - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __PYX_ERR(0, 844, __pyx_L1_error) - } - __pyx_L15:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":845 - * else: - * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) - * f += 1 # <<<<<<<<<<<<<< - * else: - * # Cython ignores struct boundary information ("T{...}"), - */ - __pyx_v_f = (__pyx_v_f + 1); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":820 - * offset[0] += child.itemsize - * - * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< - * t = child.type_num - * if end - f < 5: - */ - goto __pyx_L13; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":849 - * # Cython ignores struct boundary information ("T{...}"), - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< - * return f - * - */ - /*else*/ { - __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) __PYX_ERR(0, 849, __pyx_L1_error) - __pyx_v_f = __pyx_t_9; - } - __pyx_L13:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":794 - * cdef tuple fields - * - * for childname in descr.names: # <<<<<<<<<<<<<< - * fields = descr.fields[childname] - * child, new_offset = fields - */ - } - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":850 - * # so don't output it - * f = _util_dtypestring(child, f, end, offset) - * return f # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_f; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":785 - * return PyArray_MultiIterNew(5, a, b, c, d, e) - * - * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< - * # Recursive utility function used in __getbuffer__ to get format - * # string. The new location in the format string is returned. - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); - __pyx_r = NULL; - __pyx_L0:; - __Pyx_XDECREF((PyObject *)__pyx_v_child); - __Pyx_XDECREF(__pyx_v_fields); - __Pyx_XDECREF(__pyx_v_childname); - __Pyx_XDECREF(__pyx_v_new_offset); - __Pyx_XDECREF(__pyx_v_t); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - -static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { - PyObject *__pyx_v_baseptr; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - int __pyx_t_2; - __Pyx_RefNannySetupContext("set_array_base", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - __pyx_t_1 = (__pyx_v_base == Py_None); - __pyx_t_2 = (__pyx_t_1 != 0); - if (__pyx_t_2) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":969 - * cdef PyObject* baseptr - * if base is None: - * baseptr = NULL # <<<<<<<<<<<<<< - * else: - * Py_INCREF(base) # important to do this before decref below! - */ - __pyx_v_baseptr = NULL; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":968 - * cdef inline void set_array_base(ndarray arr, object base): - * cdef PyObject* baseptr - * if base is None: # <<<<<<<<<<<<<< - * baseptr = NULL - * else: - */ - goto __pyx_L3; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":971 - * baseptr = NULL - * else: - * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< - * baseptr = base - * Py_XDECREF(arr.base) - */ - /*else*/ { - Py_INCREF(__pyx_v_base); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":972 - * else: - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base # <<<<<<<<<<<<<< - * Py_XDECREF(arr.base) - * arr.base = baseptr - */ - __pyx_v_baseptr = ((PyObject *)__pyx_v_base); - } - __pyx_L3:; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":973 - * Py_INCREF(base) # important to do this before decref below! - * baseptr = base - * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< - * arr.base = baseptr - * - */ - Py_XDECREF(__pyx_v_arr->base); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":974 - * baseptr = base - * Py_XDECREF(arr.base) - * arr.base = baseptr # <<<<<<<<<<<<<< - * - * cdef inline object get_array_base(ndarray arr): - */ - __pyx_v_arr->base = __pyx_v_baseptr; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":966 - * - * - * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< - * cdef PyObject* baseptr - * if base is None: - */ - - /* function exit code */ - __Pyx_RefNannyFinishContext(); -} - -/* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - -static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { - PyObject *__pyx_r = NULL; - __Pyx_RefNannyDeclarations - int __pyx_t_1; - __Pyx_RefNannySetupContext("get_array_base", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); - if (__pyx_t_1) { - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":978 - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: - * return None # <<<<<<<<<<<<<< - * else: - * return arr.base - */ - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(Py_None); - __pyx_r = Py_None; - goto __pyx_L0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":977 - * - * cdef inline object get_array_base(ndarray arr): - * if arr.base is NULL: # <<<<<<<<<<<<<< - * return None - * else: - */ - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":980 - * return None - * else: - * return arr.base # <<<<<<<<<<<<<< - */ - /*else*/ { - __Pyx_XDECREF(__pyx_r); - __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); - __pyx_r = ((PyObject *)__pyx_v_arr->base); - goto __pyx_L0; - } - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /* function exit code */ - __pyx_L0:; - __Pyx_XGIVEREF(__pyx_r); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "stlcontainers", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, - {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, - {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, - {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, - {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, - {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, - {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 218, __pyx_L1_error) - __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 231, __pyx_L1_error) - __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 799, __pyx_L1_error) - return 0; - __pyx_L1_error:; - return -1; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":218 - * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): - * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< - * - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - */ - __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 218, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple_); - __Pyx_GIVEREF(__pyx_tuple_); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":222 - * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) - * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): - * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< - * - * info.buf = PyArray_DATA(self) - */ - __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 222, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__2); - __Pyx_GIVEREF(__pyx_tuple__2); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":259 - * if ((descr.byteorder == c'>' and little_endian) or - * (descr.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * if t == NPY_BYTE: f = "b" - * elif t == NPY_UBYTE: f = "B" - */ - __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 259, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__3); - __Pyx_GIVEREF(__pyx_tuple__3); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":799 - * - * if (end - f) - (new_offset - offset[0]) < 15: - * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< - * - * if ((child.byteorder == c'>' and little_endian) or - */ - __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 799, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__4); - __Pyx_GIVEREF(__pyx_tuple__4); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":803 - * if ((child.byteorder == c'>' and little_endian) or - * (child.byteorder == c'<' and not little_endian)): - * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< - * # One could encode it in the format string and have Cython - * # complain instead, BUT: < and > in format strings also imply - */ - __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 803, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__5); - __Pyx_GIVEREF(__pyx_tuple__5); - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":823 - * t = child.type_num - * if end - f < 5: - * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< - * - * # Until ticket #99 is fixed, use integers to avoid warnings - */ - __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 823, __pyx_L1_error) - __Pyx_GOTREF(__pyx_tuple__6); - __Pyx_GIVEREF(__pyx_tuple__6); - __Pyx_RefNannyFinishContext(); - return 0; - __pyx_L1_error:; - __Pyx_RefNannyFinishContext(); - return -1; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initstlcontainers(void); /*proto*/ -PyMODINIT_FUNC initstlcontainers(void) -#else -PyMODINIT_FUNC PyInit_stlcontainers(void); /*proto*/ -PyMODINIT_FUNC PyInit_stlcontainers(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - int __pyx_t_2; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_stlcontainers(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("stlcontainers", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main__yap__stlcontainers) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "_yap.stlcontainers")) { - if (unlikely(PyDict_SetItemString(modules, "_yap.stlcontainers", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", - #if CYTHON_COMPILING_IN_PYPY - sizeof(PyTypeObject), - #else - sizeof(PyHeapTypeObject), - #endif - 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(2, 9, __pyx_L1_error) - __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(0, 155, __pyx_L1_error) - __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(0, 168, __pyx_L1_error) - __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(0, 172, __pyx_L1_error) - __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(0, 181, __pyx_L1_error) - __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(0, 861, __pyx_L1_error) - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error) - #endif - - /* "_yap/stlcontainers.pyx":20 - * - * # Python Imports - * import collections # <<<<<<<<<<<<<< - * - * cimport numpy as np - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_1) < 0) __PYX_ERR(1, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "_yap/stlcontainers.pyx":23 - * - * cimport numpy as np - * import numpy as np # <<<<<<<<<<<<<< - * - * np.import_array() - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "_yap/stlcontainers.pyx":25 - * import numpy as np - * - * np.import_array() # <<<<<<<<<<<<<< - * - * cimport xdress_extra_types - */ - import_array(); - - /* "_yap/stlcontainers.pyx":35 - * - * - * if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< - * basestring = str - * - */ - __pyx_t_2 = ((PY_MAJOR_VERSION >= 3) != 0); - if (__pyx_t_2) { - - /* "_yap/stlcontainers.pyx":36 - * - * if PY_MAJOR_VERSION >= 3: - * basestring = str # <<<<<<<<<<<<<< - * - * # Dirty ifdef, else, else preprocessor hack - */ - if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, ((PyObject *)(&PyString_Type))) < 0) __PYX_ERR(1, 36, __pyx_L1_error) - - /* "_yap/stlcontainers.pyx":35 - * - * - * if PY_MAJOR_VERSION >= 3: # <<<<<<<<<<<<<< - * basestring = str - * - */ - } - - /* "_yap/stlcontainers.pyx":1 - * ################### # <<<<<<<<<<<<<< - * ### WARNING!!! ### - * ################### - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "../../../../../usr/local/lib/python3.5/site-packages/Cython/Includes/numpy/__init__.pxd":976 - * arr.base = baseptr - * - * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< - * if arr.base is NULL: - * return None - */ - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init _yap.stlcontainers", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init _yap.stlcontainers"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* RaiseException */ -#if PY_MAJOR_VERSION < 3 -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, - CYTHON_UNUSED PyObject *cause) { - __Pyx_PyThreadState_declare - Py_XINCREF(type); - if (!value || value == Py_None) - value = NULL; - else - Py_INCREF(value); - if (!tb || tb == Py_None) - tb = NULL; - else { - Py_INCREF(tb); - if (!PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto raise_error; - } - } - if (PyType_Check(type)) { -#if CYTHON_COMPILING_IN_PYPY - if (!value) { - Py_INCREF(Py_None); - value = Py_None; - } -#endif - PyErr_NormalizeException(&type, &value, &tb); - } else { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto raise_error; - } - value = type; - type = (PyObject*) Py_TYPE(type); - Py_INCREF(type); - if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto raise_error; - } - } - __Pyx_PyThreadState_assign - __Pyx_ErrRestore(type, value, tb); - return; -raise_error: - Py_XDECREF(value); - Py_XDECREF(type); - Py_XDECREF(tb); - return; -} -#else -static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { - PyObject* owned_instance = NULL; - if (tb == Py_None) { - tb = 0; - } else if (tb && !PyTraceBack_Check(tb)) { - PyErr_SetString(PyExc_TypeError, - "raise: arg 3 must be a traceback or None"); - goto bad; - } - if (value == Py_None) - value = 0; - if (PyExceptionInstance_Check(type)) { - if (value) { - PyErr_SetString(PyExc_TypeError, - "instance exception may not have a separate value"); - goto bad; - } - value = type; - type = (PyObject*) Py_TYPE(value); - } else if (PyExceptionClass_Check(type)) { - PyObject *instance_class = NULL; - if (value && PyExceptionInstance_Check(value)) { - instance_class = (PyObject*) Py_TYPE(value); - if (instance_class != type) { - int is_subclass = PyObject_IsSubclass(instance_class, type); - if (!is_subclass) { - instance_class = NULL; - } else if (unlikely(is_subclass == -1)) { - goto bad; - } else { - type = instance_class; - } - } - } - if (!instance_class) { - PyObject *args; - if (!value) - args = PyTuple_New(0); - else if (PyTuple_Check(value)) { - Py_INCREF(value); - args = value; - } else - args = PyTuple_Pack(1, value); - if (!args) - goto bad; - owned_instance = PyObject_Call(type, args, NULL); - Py_DECREF(args); - if (!owned_instance) - goto bad; - value = owned_instance; - if (!PyExceptionInstance_Check(value)) { - PyErr_Format(PyExc_TypeError, - "calling %R should have returned an instance of " - "BaseException, not %R", - type, Py_TYPE(value)); - goto bad; - } - } - } else { - PyErr_SetString(PyExc_TypeError, - "raise: exception class must be a subclass of BaseException"); - goto bad; - } -#if PY_VERSION_HEX >= 0x03030000 - if (cause) { -#else - if (cause && cause != Py_None) { -#endif - PyObject *fixed_cause; - if (cause == Py_None) { - fixed_cause = NULL; - } else if (PyExceptionClass_Check(cause)) { - fixed_cause = PyObject_CallObject(cause, NULL); - if (fixed_cause == NULL) - goto bad; - } else if (PyExceptionInstance_Check(cause)) { - fixed_cause = cause; - Py_INCREF(fixed_cause); - } else { - PyErr_SetString(PyExc_TypeError, - "exception causes must derive from " - "BaseException"); - goto bad; - } - PyException_SetCause(value, fixed_cause); - } - PyErr_SetObject(type, value); - if (tb) { -#if CYTHON_COMPILING_IN_PYPY - PyObject *tmp_type, *tmp_value, *tmp_tb; - PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb); - Py_INCREF(tb); - PyErr_Restore(tmp_type, tmp_value, tb); - Py_XDECREF(tmp_tb); -#else - PyThreadState *tstate = PyThreadState_GET(); - PyObject* tmp_tb = tstate->curexc_traceback; - if (tb != tmp_tb) { - Py_INCREF(tb); - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_tb); - } -#endif - } -bad: - Py_XDECREF(owned_instance); - return; -} -#endif - -/* RaiseTooManyValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { - PyErr_Format(PyExc_ValueError, - "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); -} - -/* RaiseNeedMoreValuesToUnpack */ - static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { - PyErr_Format(PyExc_ValueError, - "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", - index, (index == 1) ? "" : "s"); -} - -/* RaiseNoneIterError */ - static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { - PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); -} - -/* ExtTypeTest */ - static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { - if (unlikely(!type)) { - PyErr_SetString(PyExc_SystemError, "Missing type object"); - return 0; - } - if (likely(PyObject_TypeCheck(obj, type))) - return 1; - PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", - Py_TYPE(obj)->tp_name, type->tp_name); - return 0; -} - -/* Import */ - static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return ::std::complex< float >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - return x + y*(__pyx_t_float_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { - __pyx_t_float_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { - __pyx_t_float_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrtf(z.real*z.real + z.imag*z.imag); - #else - return hypotf(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { - __pyx_t_float_complex z; - float r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - float denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(a, a); - case 3: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, a); - case 4: - z = __Pyx_c_prodf(a, a); - return __Pyx_c_prodf(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_absf(a); - theta = atan2f(a.imag, a.real); - } - lnr = logf(r); - z_r = expf(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cosf(z_theta); - z.imag = z_r * sinf(z_theta); - return z; - } - #endif -#endif - -/* None */ - #if CYTHON_CCOMPLEX - #ifdef __cplusplus - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return ::std::complex< double >(x, y); - } - #else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - return x + y*(__pyx_t_double_complex)_Complex_I; - } - #endif -#else - static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { - __pyx_t_double_complex z; - z.real = x; - z.imag = y; - return z; - } -#endif - -/* None */ - #if CYTHON_CCOMPLEX -#else - static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { - return (a.real == b.real) && (a.imag == b.imag); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real + b.real; - z.imag = a.imag + b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real - b.real; - z.imag = a.imag - b.imag; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - z.real = a.real * b.real - a.imag * b.imag; - z.imag = a.real * b.imag + a.imag * b.real; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double denom = b.real * b.real + b.imag * b.imag; - z.real = (a.real * b.real + a.imag * b.imag) / denom; - z.imag = (a.imag * b.real - a.real * b.imag) / denom; - return z; - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = -a.real; - z.imag = -a.imag; - return z; - } - static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { - return (a.real == 0) && (a.imag == 0); - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { - __pyx_t_double_complex z; - z.real = a.real; - z.imag = -a.imag; - return z; - } - #if 1 - static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { - #if !defined(HAVE_HYPOT) || defined(_MSC_VER) - return sqrt(z.real*z.real + z.imag*z.imag); - #else - return hypot(z.real, z.imag); - #endif - } - static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { - __pyx_t_double_complex z; - double r, lnr, theta, z_r, z_theta; - if (b.imag == 0 && b.real == (int)b.real) { - if (b.real < 0) { - double denom = a.real * a.real + a.imag * a.imag; - a.real = a.real / denom; - a.imag = -a.imag / denom; - b.real = -b.real; - } - switch ((int)b.real) { - case 0: - z.real = 1; - z.imag = 0; - return z; - case 1: - return a; - case 2: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(a, a); - case 3: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, a); - case 4: - z = __Pyx_c_prod(a, a); - return __Pyx_c_prod(z, z); - } - } - if (a.imag == 0) { - if (a.real == 0) { - return a; - } - r = a.real; - theta = 0; - } else { - r = __Pyx_c_abs(a); - theta = atan2(a.imag, a.real); - } - lnr = log(r); - z_r = exp(lnr * b.real - theta * b.imag); - z_theta = theta * b.real + lnr * b.imag; - z.real = z_r * cos(z_theta); - z.imag = z_r * sin(z_theta); - return z; - } - #endif -#endif - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(int) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(int) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(int), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) { - const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(enum NPY_TYPES) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(enum NPY_TYPES) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* ModuleImport */ - #ifndef __PYX_HAVE_RT_ImportModule -#define __PYX_HAVE_RT_ImportModule -static PyObject *__Pyx_ImportModule(const char *name) { - PyObject *py_name = 0; - PyObject *py_module = 0; - py_name = __Pyx_PyIdentifier_FromString(name); - if (!py_name) - goto bad; - py_module = PyImport_Import(py_name); - Py_DECREF(py_name); - return py_module; -bad: - Py_XDECREF(py_name); - return 0; -} -#endif - -/* TypeImport */ - #ifndef __PYX_HAVE_RT_ImportType -#define __PYX_HAVE_RT_ImportType -static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, - size_t size, int strict) -{ - PyObject *py_module = 0; - PyObject *result = 0; - PyObject *py_name = 0; - char warning[200]; - Py_ssize_t basicsize; -#ifdef Py_LIMITED_API - PyObject *py_basicsize; -#endif - py_module = __Pyx_ImportModule(module_name); - if (!py_module) - goto bad; - py_name = __Pyx_PyIdentifier_FromString(class_name); - if (!py_name) - goto bad; - result = PyObject_GetAttr(py_module, py_name); - Py_DECREF(py_name); - py_name = 0; - Py_DECREF(py_module); - py_module = 0; - if (!result) - goto bad; - if (!PyType_Check(result)) { - PyErr_Format(PyExc_TypeError, - "%.200s.%.200s is not a type object", - module_name, class_name); - goto bad; - } -#ifndef Py_LIMITED_API - basicsize = ((PyTypeObject *)result)->tp_basicsize; -#else - py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); - if (!py_basicsize) - goto bad; - basicsize = PyLong_AsSsize_t(py_basicsize); - Py_DECREF(py_basicsize); - py_basicsize = 0; - if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) - goto bad; -#endif - if (!strict && (size_t)basicsize > size) { - PyOS_snprintf(warning, sizeof(warning), - "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; - } - else if ((size_t)basicsize != size) { - PyErr_Format(PyExc_ValueError, - "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd", - module_name, class_name, basicsize, size); - goto bad; - } - return (PyTypeObject *)result; -bad: - Py_XDECREF(py_module); - Py_XDECREF(result); - return NULL; -} -#endif - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/stlcontainers.pxd b/CXX/_yap/stlcontainers.pxd deleted file mode 100644 index 4312eba6b..000000000 --- a/CXX/_yap/stlcontainers.pxd +++ /dev/null @@ -1,30 +0,0 @@ -################### -### WARNING!!! ### -################### -# This file has been autogenerated - -# Cython imports -from cython.operator cimport dereference as deref -from cython.operator cimport preincrement as inc -from libcpp.string cimport string as std_string -from libcpp.utility cimport pair -from libcpp.map cimport map as cpp_map -from libcpp.set cimport set as cpp_set -from libcpp.vector cimport vector as cpp_vector -from libcpp cimport bool as cpp_bool -from libc cimport stdio -from cpython.version cimport PY_MAJOR_VERSION -from cpython.ref cimport PyTypeObject, Py_INCREF, Py_XDECREF - -# Python Imports -cimport numpy as np - -# Local imports -cimport xdress_extra_types - -cimport numpy as np - - -# Cython Imports For Types - - diff --git a/CXX/_yap/stlcontainers.pyx b/CXX/_yap/stlcontainers.pyx deleted file mode 100644 index 32380fa0b..000000000 --- a/CXX/_yap/stlcontainers.pyx +++ /dev/null @@ -1,45 +0,0 @@ -################### -### WARNING!!! ### -################### -# This file has been autogenerated - -# Cython imports -from cython.operator cimport dereference as deref -from cython.operator cimport preincrement as inc -from libc.stdlib cimport malloc, free -from libc.string cimport memcpy -from libcpp.string cimport string as std_string -from libcpp.utility cimport pair -from libcpp.map cimport map as cpp_map -from libcpp.set cimport set as cpp_set -from libcpp cimport bool as cpp_bool -from libcpp.vector cimport vector as cpp_vector -from cpython.version cimport PY_MAJOR_VERSION - -# Python Imports -import collections - -cimport numpy as np -import numpy as np - -np.import_array() - -cimport xdress_extra_types - -# Cython Imports For Types - - -# Imports For Types - - -if PY_MAJOR_VERSION >= 3: - basestring = str - -# Dirty ifdef, else, else preprocessor hack -# see http://comments.gmane.org/gmane.comp.python.cython.user/4080 -cdef extern from *: - cdef void emit_ifpy2k "#if PY_MAJOR_VERSION == 2 //" () - cdef void emit_ifpy3k "#if PY_MAJOR_VERSION == 3 //" () - cdef void emit_else "#else //" () - cdef void emit_endif "#endif //" () - diff --git a/CXX/_yap/tests/test_dtypes.c b/CXX/_yap/tests/test_dtypes.c deleted file mode 100644 index 9f656ce8c..000000000 --- a/CXX/_yap/tests/test_dtypes.c +++ /dev/null @@ -1,2276 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -/* BEGIN: Cython Metadata -{ - "distutils": {}, - "module_name": "test_dtypes" -} -END: Cython Metadata */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__test_dtypes -#define __PYX_HAVE_API__test_dtypes -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_yap/tests/test_dtypes.py", -}; - -/*--- Type declarations ---*/ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals -#else -#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectCallNoArg.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'test_dtypes' */ -#define __Pyx_MODULE_NAME "test_dtypes" -int __pyx_module_is_main_test_dtypes = 0; - -/* Implementation of 'test_dtypes' */ -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_os[] = "os"; -static const char __pyx_k_run[] = "run"; -static const char __pyx_k_yap[] = "_yap"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_nose[] = "nose"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_dtypes[] = "dtypes"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_raises[] = "raises"; -static const char __pyx_k_assert_in[] = "assert_in"; -static const char __pyx_k_nose_tools[] = "nose.tools"; -static const char __pyx_k_assert_true[] = "assert_true"; -static const char __pyx_k_assert_equal[] = "assert_equal"; -static const char __pyx_k_assert_false[] = "assert_false"; -static const char __pyx_k_assert_raises[] = "assert_raises"; -static const char __pyx_k_numpy_testing[] = "numpy.testing"; -static const char __pyx_k_assert_not_equal[] = "assert_not_equal"; -static const char __pyx_k_assert_array_equal[] = "assert_array_equal"; -static const char __pyx_k_assert_almost_equal[] = "assert_almost_equal"; -static const char __pyx_k_assert_array_almost_equal[] = "assert_array_almost_equal"; -static const char __pyx_k_Tests_the_part_of_dtypes_that_is[] = "Tests the part of dtypes that is accessible from Python."; -static PyObject *__pyx_n_s_assert_almost_equal; -static PyObject *__pyx_n_s_assert_array_almost_equal; -static PyObject *__pyx_n_s_assert_array_equal; -static PyObject *__pyx_n_s_assert_equal; -static PyObject *__pyx_n_s_assert_false; -static PyObject *__pyx_n_s_assert_in; -static PyObject *__pyx_n_s_assert_not_equal; -static PyObject *__pyx_n_s_assert_raises; -static PyObject *__pyx_n_s_assert_true; -static PyObject *__pyx_n_s_dtypes; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_nose; -static PyObject *__pyx_n_s_nose_tools; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_numpy_testing; -static PyObject *__pyx_n_s_os; -static PyObject *__pyx_n_s_raises; -static PyObject *__pyx_n_s_run; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_yap; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "test_dtypes", - __pyx_k_Tests_the_part_of_dtypes_that_is, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_assert_almost_equal, __pyx_k_assert_almost_equal, sizeof(__pyx_k_assert_almost_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_array_almost_equal, __pyx_k_assert_array_almost_equal, sizeof(__pyx_k_assert_array_almost_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_array_equal, __pyx_k_assert_array_equal, sizeof(__pyx_k_assert_array_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_equal, __pyx_k_assert_equal, sizeof(__pyx_k_assert_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_false, __pyx_k_assert_false, sizeof(__pyx_k_assert_false), 0, 0, 1, 1}, - {&__pyx_n_s_assert_in, __pyx_k_assert_in, sizeof(__pyx_k_assert_in), 0, 0, 1, 1}, - {&__pyx_n_s_assert_not_equal, __pyx_k_assert_not_equal, sizeof(__pyx_k_assert_not_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_raises, __pyx_k_assert_raises, sizeof(__pyx_k_assert_raises), 0, 0, 1, 1}, - {&__pyx_n_s_assert_true, __pyx_k_assert_true, sizeof(__pyx_k_assert_true), 0, 0, 1, 1}, - {&__pyx_n_s_dtypes, __pyx_k_dtypes, sizeof(__pyx_k_dtypes), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_nose, __pyx_k_nose, sizeof(__pyx_k_nose), 0, 0, 1, 1}, - {&__pyx_n_s_nose_tools, __pyx_k_nose_tools, sizeof(__pyx_k_nose_tools), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_numpy_testing, __pyx_k_numpy_testing, sizeof(__pyx_k_numpy_testing), 0, 0, 1, 1}, - {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, - {&__pyx_n_s_raises, __pyx_k_raises, sizeof(__pyx_k_raises), 0, 0, 1, 1}, - {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_yap, __pyx_k_yap, sizeof(__pyx_k_yap), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC inittest_dtypes(void); /*proto*/ -PyMODINIT_FUNC inittest_dtypes(void) -#else -PyMODINIT_FUNC PyInit_test_dtypes(void); /*proto*/ -PyMODINIT_FUNC PyInit_test_dtypes(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_test_dtypes(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("test_dtypes", __pyx_methods, __pyx_k_Tests_the_part_of_dtypes_that_is, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_test_dtypes) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "test_dtypes")) { - if (unlikely(PyDict_SetItemString(modules, "test_dtypes", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "test_dtypes.py":8 - * from __future__ import print_function - * - * import nose # <<<<<<<<<<<<<< - * from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ - * assert_almost_equal, assert_true, assert_false, assert_in - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_nose, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nose, __pyx_t_1) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_dtypes.py":9 - * - * import nose - * from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ # <<<<<<<<<<<<<< - * assert_almost_equal, assert_true, assert_false, assert_in - * - */ - __pyx_t_1 = PyList_New(8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_assert_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_equal); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_assert_equal); - __Pyx_INCREF(__pyx_n_s_assert_not_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_not_equal); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_assert_not_equal); - __Pyx_INCREF(__pyx_n_s_assert_raises); - __Pyx_GIVEREF(__pyx_n_s_assert_raises); - PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_assert_raises); - __Pyx_INCREF(__pyx_n_s_raises); - __Pyx_GIVEREF(__pyx_n_s_raises); - PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_raises); - __Pyx_INCREF(__pyx_n_s_assert_almost_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_almost_equal); - PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_assert_almost_equal); - __Pyx_INCREF(__pyx_n_s_assert_true); - __Pyx_GIVEREF(__pyx_n_s_assert_true); - PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_assert_true); - __Pyx_INCREF(__pyx_n_s_assert_false); - __Pyx_GIVEREF(__pyx_n_s_assert_false); - PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_assert_false); - __Pyx_INCREF(__pyx_n_s_assert_in); - __Pyx_GIVEREF(__pyx_n_s_assert_in); - PyList_SET_ITEM(__pyx_t_1, 7, __pyx_n_s_assert_in); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_nose_tools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_equal, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_not_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_not_equal, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_raises); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_raises, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_raises); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_raises, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_almost_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_almost_equal, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_true); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_true, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_false); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_false, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_in, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_dtypes.py":12 - * assert_almost_equal, assert_true, assert_false, assert_in - * - * from numpy.testing import assert_array_equal, assert_array_almost_equal # <<<<<<<<<<<<<< - * - * import os - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_assert_array_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_array_equal); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_assert_array_equal); - __Pyx_INCREF(__pyx_n_s_assert_array_almost_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_array_almost_equal); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_assert_array_almost_equal); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy_testing, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_array_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_array_equal, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_array_almost_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_array_almost_equal, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_dtypes.py":14 - * from numpy.testing import assert_array_equal, assert_array_almost_equal - * - * import os # <<<<<<<<<<<<<< - * import numpy as np - * - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_dtypes.py":15 - * - * import os - * import numpy as np # <<<<<<<<<<<<<< - * - * from _yap import dtypes - */ - __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_dtypes.py":17 - * import numpy as np - * - * from _yap import dtypes # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_dtypes); - __Pyx_GIVEREF(__pyx_n_s_dtypes); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_dtypes); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_yap, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_dtypes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_dtypes, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_dtypes.py":20 - * - * - * if __name__ == '__main__': # <<<<<<<<<<<<<< - * nose.run() - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 20, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "test_dtypes.py":21 - * - * if __name__ == '__main__': - * nose.run() # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_run); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_dtypes.py":20 - * - * - * if __name__ == '__main__': # <<<<<<<<<<<<<< - * nose.run() - */ - } - - /* "test_dtypes.py":1 - * """Tests the part of dtypes that is accessible from Python.""" # <<<<<<<<<<<<<< - * ################### - * ### WARNING!!! ### - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init test_dtypes", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init test_dtypes"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* GetModuleGlobalName */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* PyObjectCall */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -#endif - -/* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/tests/test_dtypes.py b/CXX/_yap/tests/test_dtypes.py deleted file mode 100644 index 384bab3ea..000000000 --- a/CXX/_yap/tests/test_dtypes.py +++ /dev/null @@ -1,21 +0,0 @@ -"""Tests the part of dtypes that is accessible from Python.""" -################### -### WARNING!!! ### -################### -# This file has been autogenerated -from __future__ import print_function - -import nose -from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ - assert_almost_equal, assert_true, assert_false, assert_in - -from numpy.testing import assert_array_equal, assert_array_almost_equal - -import os -import numpy as np - -from _yap import dtypes - - -if __name__ == '__main__': - nose.run() diff --git a/CXX/_yap/tests/test_stlcontainers.c b/CXX/_yap/tests/test_stlcontainers.c deleted file mode 100644 index 50a317e6a..000000000 --- a/CXX/_yap/tests/test_stlcontainers.c +++ /dev/null @@ -1,2340 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -/* BEGIN: Cython Metadata -{ - "distutils": {}, - "module_name": "test_stlcontainers" -} -END: Cython Metadata */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE__test_stlcontainers -#define __PYX_HAVE_API__test_stlcontainers -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_yap/tests/test_stlcontainers.py", -}; - -/*--- Type declarations ---*/ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* Import.proto */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); - -/* ImportFrom.proto */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); - -/* GetBuiltinName.proto */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name); - -/* GetModuleGlobalName.proto */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); - -/* IncludeStringH.proto */ -#include - -/* BytesEquals.proto */ -static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); - -/* UnicodeEquals.proto */ -static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); - -/* StrEquals.proto */ -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals -#else -#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals -#endif - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectCallMethO.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg); -#endif - -/* PyObjectCallOneArg.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg); - -/* PyObjectCallNoArg.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func); -#else -#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL) -#endif - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'test_stlcontainers' */ -#define __Pyx_MODULE_NAME "test_stlcontainers" -int __pyx_module_is_main_test_stlcontainers = 0; - -/* Implementation of 'test_stlcontainers' */ -static const char __pyx_k_np[] = "np"; -static const char __pyx_k_os[] = "os"; -static const char __pyx_k_run[] = "run"; -static const char __pyx_k_yap[] = "_yap"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_name[] = "__name__"; -static const char __pyx_k_nose[] = "nose"; -static const char __pyx_k_test[] = "__test__"; -static const char __pyx_k_numpy[] = "numpy"; -static const char __pyx_k_import[] = "__import__"; -static const char __pyx_k_raises[] = "raises"; -static const char __pyx_k_Mapping[] = "Mapping"; -static const char __pyx_k_TestCase[] = "TestCase"; -static const char __pyx_k_unittest[] = "unittest"; -static const char __pyx_k_Container[] = "Container"; -static const char __pyx_k_assert_in[] = "assert_in"; -static const char __pyx_k_nose_tools[] = "nose.tools"; -static const char __pyx_k_assert_true[] = "assert_true"; -static const char __pyx_k_collections[] = "collections"; -static const char __pyx_k_assert_equal[] = "assert_equal"; -static const char __pyx_k_assert_false[] = "assert_false"; -static const char __pyx_k_assert_raises[] = "assert_raises"; -static const char __pyx_k_numpy_testing[] = "numpy.testing"; -static const char __pyx_k_stlcontainers[] = "stlcontainers"; -static const char __pyx_k_assert_not_equal[] = "assert_not_equal"; -static const char __pyx_k_assert_array_equal[] = "assert_array_equal"; -static const char __pyx_k_assert_almost_equal[] = "assert_almost_equal"; -static const char __pyx_k_assert_array_almost_equal[] = "assert_array_almost_equal"; -static const char __pyx_k_Tests_the_part_of_stlconverters[] = "Tests the part of stlconverters that is accessible from Python."; -static PyObject *__pyx_n_s_Container; -static PyObject *__pyx_n_s_Mapping; -static PyObject *__pyx_n_s_TestCase; -static PyObject *__pyx_n_s_assert_almost_equal; -static PyObject *__pyx_n_s_assert_array_almost_equal; -static PyObject *__pyx_n_s_assert_array_equal; -static PyObject *__pyx_n_s_assert_equal; -static PyObject *__pyx_n_s_assert_false; -static PyObject *__pyx_n_s_assert_in; -static PyObject *__pyx_n_s_assert_not_equal; -static PyObject *__pyx_n_s_assert_raises; -static PyObject *__pyx_n_s_assert_true; -static PyObject *__pyx_n_s_collections; -static PyObject *__pyx_n_s_import; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_name; -static PyObject *__pyx_n_s_nose; -static PyObject *__pyx_n_s_nose_tools; -static PyObject *__pyx_n_s_np; -static PyObject *__pyx_n_s_numpy; -static PyObject *__pyx_n_s_numpy_testing; -static PyObject *__pyx_n_s_os; -static PyObject *__pyx_n_s_raises; -static PyObject *__pyx_n_s_run; -static PyObject *__pyx_n_s_stlcontainers; -static PyObject *__pyx_n_s_test; -static PyObject *__pyx_n_s_unittest; -static PyObject *__pyx_n_s_yap; - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "test_stlcontainers", - __pyx_k_Tests_the_part_of_stlconverters, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_Container, __pyx_k_Container, sizeof(__pyx_k_Container), 0, 0, 1, 1}, - {&__pyx_n_s_Mapping, __pyx_k_Mapping, sizeof(__pyx_k_Mapping), 0, 0, 1, 1}, - {&__pyx_n_s_TestCase, __pyx_k_TestCase, sizeof(__pyx_k_TestCase), 0, 0, 1, 1}, - {&__pyx_n_s_assert_almost_equal, __pyx_k_assert_almost_equal, sizeof(__pyx_k_assert_almost_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_array_almost_equal, __pyx_k_assert_array_almost_equal, sizeof(__pyx_k_assert_array_almost_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_array_equal, __pyx_k_assert_array_equal, sizeof(__pyx_k_assert_array_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_equal, __pyx_k_assert_equal, sizeof(__pyx_k_assert_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_false, __pyx_k_assert_false, sizeof(__pyx_k_assert_false), 0, 0, 1, 1}, - {&__pyx_n_s_assert_in, __pyx_k_assert_in, sizeof(__pyx_k_assert_in), 0, 0, 1, 1}, - {&__pyx_n_s_assert_not_equal, __pyx_k_assert_not_equal, sizeof(__pyx_k_assert_not_equal), 0, 0, 1, 1}, - {&__pyx_n_s_assert_raises, __pyx_k_assert_raises, sizeof(__pyx_k_assert_raises), 0, 0, 1, 1}, - {&__pyx_n_s_assert_true, __pyx_k_assert_true, sizeof(__pyx_k_assert_true), 0, 0, 1, 1}, - {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1}, - {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, - {&__pyx_n_s_nose, __pyx_k_nose, sizeof(__pyx_k_nose), 0, 0, 1, 1}, - {&__pyx_n_s_nose_tools, __pyx_k_nose_tools, sizeof(__pyx_k_nose_tools), 0, 0, 1, 1}, - {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, - {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, - {&__pyx_n_s_numpy_testing, __pyx_k_numpy_testing, sizeof(__pyx_k_numpy_testing), 0, 0, 1, 1}, - {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1}, - {&__pyx_n_s_raises, __pyx_k_raises, sizeof(__pyx_k_raises), 0, 0, 1, 1}, - {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1}, - {&__pyx_n_s_stlcontainers, __pyx_k_stlcontainers, sizeof(__pyx_k_stlcontainers), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {&__pyx_n_s_unittest, __pyx_k_unittest, sizeof(__pyx_k_unittest), 0, 0, 1, 1}, - {&__pyx_n_s_yap, __pyx_k_yap, sizeof(__pyx_k_yap), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC inittest_stlcontainers(void); /*proto*/ -PyMODINIT_FUNC inittest_stlcontainers(void) -#else -PyMODINIT_FUNC PyInit_test_stlcontainers(void); /*proto*/ -PyMODINIT_FUNC PyInit_test_stlcontainers(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - PyObject *__pyx_t_2 = NULL; - int __pyx_t_3; - PyObject *__pyx_t_4 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_test_stlcontainers(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("test_stlcontainers", __pyx_methods, __pyx_k_Tests_the_part_of_stlconverters, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main_test_stlcontainers) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "test_stlcontainers")) { - if (unlikely(PyDict_SetItemString(modules, "test_stlcontainers", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "test_stlcontainers.py":7 - * # This file has been autogenerated - * from __future__ import print_function - * from unittest import TestCase # <<<<<<<<<<<<<< - * import nose - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_TestCase); - __Pyx_GIVEREF(__pyx_n_s_TestCase); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_TestCase); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_unittest, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_TestCase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_TestCase, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":8 - * from __future__ import print_function - * from unittest import TestCase - * import nose # <<<<<<<<<<<<<< - * - * from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ - */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_nose, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_nose, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":10 - * import nose - * - * from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ # <<<<<<<<<<<<<< - * assert_almost_equal, assert_true, assert_false, assert_in - * - */ - __pyx_t_2 = PyList_New(8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_assert_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_equal); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_assert_equal); - __Pyx_INCREF(__pyx_n_s_assert_not_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_not_equal); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_assert_not_equal); - __Pyx_INCREF(__pyx_n_s_assert_raises); - __Pyx_GIVEREF(__pyx_n_s_assert_raises); - PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_assert_raises); - __Pyx_INCREF(__pyx_n_s_raises); - __Pyx_GIVEREF(__pyx_n_s_raises); - PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_raises); - __Pyx_INCREF(__pyx_n_s_assert_almost_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_almost_equal); - PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_assert_almost_equal); - __Pyx_INCREF(__pyx_n_s_assert_true); - __Pyx_GIVEREF(__pyx_n_s_assert_true); - PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_assert_true); - __Pyx_INCREF(__pyx_n_s_assert_false); - __Pyx_GIVEREF(__pyx_n_s_assert_false); - PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_assert_false); - __Pyx_INCREF(__pyx_n_s_assert_in); - __Pyx_GIVEREF(__pyx_n_s_assert_in); - PyList_SET_ITEM(__pyx_t_2, 7, __pyx_n_s_assert_in); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_nose_tools, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_equal, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_not_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_not_equal, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_raises); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_raises, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_raises); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_raises, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_almost_equal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_almost_equal, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_true); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_true, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_false); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_false, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_assert_in); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_in, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_stlcontainers.py":13 - * assert_almost_equal, assert_true, assert_false, assert_in - * - * from numpy.testing import assert_array_equal, assert_array_almost_equal # <<<<<<<<<<<<<< - * - * import os - */ - __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_assert_array_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_array_equal); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_assert_array_equal); - __Pyx_INCREF(__pyx_n_s_assert_array_almost_equal); - __Pyx_GIVEREF(__pyx_n_s_assert_array_almost_equal); - PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_assert_array_almost_equal); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy_testing, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_array_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_array_equal, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_assert_array_almost_equal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_assert_array_almost_equal, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":15 - * from numpy.testing import assert_array_equal, assert_array_almost_equal - * - * import os # <<<<<<<<<<<<<< - * import numpy as np - * from collections import Container, Mapping - */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":16 - * - * import os - * import numpy as np # <<<<<<<<<<<<<< - * from collections import Container, Mapping - * - */ - __pyx_t_2 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_2) < 0) __PYX_ERR(0, 16, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":17 - * import os - * import numpy as np - * from collections import Container, Mapping # <<<<<<<<<<<<<< - * - * from _yap import stlcontainers - */ - __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_n_s_Container); - __Pyx_GIVEREF(__pyx_n_s_Container); - PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Container); - __Pyx_INCREF(__pyx_n_s_Mapping); - __Pyx_GIVEREF(__pyx_n_s_Mapping); - PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_Mapping); - __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Container); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Container, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_Mapping); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mapping, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /* "test_stlcontainers.py":19 - * from collections import Container, Mapping - * - * from _yap import stlcontainers # <<<<<<<<<<<<<< - * - * - */ - __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __Pyx_INCREF(__pyx_n_s_stlcontainers); - __Pyx_GIVEREF(__pyx_n_s_stlcontainers); - PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_stlcontainers); - __pyx_t_2 = __Pyx_Import(__pyx_n_s_yap, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_stlcontainers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_stlcontainers, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":22 - * - * - * if __name__ == '__main__': # <<<<<<<<<<<<<< - * nose.run() - */ - __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 22, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - if (__pyx_t_3) { - - /* "test_stlcontainers.py":23 - * - * if __name__ == '__main__': - * nose.run() # <<<<<<<<<<<<<< - */ - __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_nose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_run); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_4); - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - __pyx_t_1 = NULL; - if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) { - __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4); - if (likely(__pyx_t_1)) { - PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4); - __Pyx_INCREF(__pyx_t_1); - __Pyx_INCREF(function); - __Pyx_DECREF_SET(__pyx_t_4, function); - } - } - if (__pyx_t_1) { - __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - } else { - __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error) - } - __Pyx_GOTREF(__pyx_t_2); - __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /* "test_stlcontainers.py":22 - * - * - * if __name__ == '__main__': # <<<<<<<<<<<<<< - * nose.run() - */ - } - - /* "test_stlcontainers.py":1 - * """Tests the part of stlconverters that is accessible from Python.""" # <<<<<<<<<<<<<< - * ################### - * ### WARNING!!! ### - */ - __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_4); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init test_stlcontainers", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init test_stlcontainers"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* Import */ -static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { - PyObject *empty_list = 0; - PyObject *module = 0; - PyObject *global_dict = 0; - PyObject *empty_dict = 0; - PyObject *list; - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_import; - py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); - if (!py_import) - goto bad; - #endif - if (from_list) - list = from_list; - else { - empty_list = PyList_New(0); - if (!empty_list) - goto bad; - list = empty_list; - } - global_dict = PyModule_GetDict(__pyx_m); - if (!global_dict) - goto bad; - empty_dict = PyDict_New(); - if (!empty_dict) - goto bad; - { - #if PY_MAJOR_VERSION >= 3 - if (level == -1) { - if (strchr(__Pyx_MODULE_NAME, '.')) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(1); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, 1); - #endif - if (!module) { - if (!PyErr_ExceptionMatches(PyExc_ImportError)) - goto bad; - PyErr_Clear(); - } - } - level = 0; - } - #endif - if (!module) { - #if PY_VERSION_HEX < 0x03030000 - PyObject *py_level = PyInt_FromLong(level); - if (!py_level) - goto bad; - module = PyObject_CallFunctionObjArgs(py_import, - name, global_dict, empty_dict, list, py_level, NULL); - Py_DECREF(py_level); - #else - module = PyImport_ImportModuleLevelObject( - name, global_dict, empty_dict, list, level); - #endif - } - } -bad: - #if PY_VERSION_HEX < 0x03030000 - Py_XDECREF(py_import); - #endif - Py_XDECREF(empty_list); - Py_XDECREF(empty_dict); - return module; -} - -/* ImportFrom */ -static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) { - PyObject* value = __Pyx_PyObject_GetAttrStr(module, name); - if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) { - PyErr_Format(PyExc_ImportError, - #if PY_MAJOR_VERSION < 3 - "cannot import name %.230s", PyString_AS_STRING(name)); - #else - "cannot import name %S", name); - #endif - } - return value; -} - -/* GetBuiltinName */ -static PyObject *__Pyx_GetBuiltinName(PyObject *name) { - PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); - if (unlikely(!result)) { - PyErr_Format(PyExc_NameError, -#if PY_MAJOR_VERSION >= 3 - "name '%U' is not defined", name); -#else - "name '%.200s' is not defined", PyString_AS_STRING(name)); -#endif - } - return result; -} - -/* GetModuleGlobalName */ -static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { - PyObject *result; -#if CYTHON_COMPILING_IN_CPYTHON - result = PyDict_GetItem(__pyx_d, name); - if (likely(result)) { - Py_INCREF(result); - } else { -#else - result = PyObject_GetItem(__pyx_d, name); - if (!result) { - PyErr_Clear(); -#endif - result = __Pyx_GetBuiltinName(name); - } - return result; -} - -/* BytesEquals */ - static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else - if (s1 == s2) { - return (equals == Py_EQ); - } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { - const char *ps1, *ps2; - Py_ssize_t length = PyBytes_GET_SIZE(s1); - if (length != PyBytes_GET_SIZE(s2)) - return (equals == Py_NE); - ps1 = PyBytes_AS_STRING(s1); - ps2 = PyBytes_AS_STRING(s2); - if (ps1[0] != ps2[0]) { - return (equals == Py_NE); - } else if (length == 1) { - return (equals == Py_EQ); - } else { - int result = memcmp(ps1, ps2, (size_t)length); - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { - return (equals == Py_NE); - } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { - return (equals == Py_NE); - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -#endif -} - -/* UnicodeEquals */ - static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { -#if CYTHON_COMPILING_IN_PYPY - return PyObject_RichCompareBool(s1, s2, equals); -#else -#if PY_MAJOR_VERSION < 3 - PyObject* owned_ref = NULL; -#endif - int s1_is_unicode, s2_is_unicode; - if (s1 == s2) { - goto return_eq; - } - s1_is_unicode = PyUnicode_CheckExact(s1); - s2_is_unicode = PyUnicode_CheckExact(s2); -#if PY_MAJOR_VERSION < 3 - if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { - owned_ref = PyUnicode_FromObject(s2); - if (unlikely(!owned_ref)) - return -1; - s2 = owned_ref; - s2_is_unicode = 1; - } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { - owned_ref = PyUnicode_FromObject(s1); - if (unlikely(!owned_ref)) - return -1; - s1 = owned_ref; - s1_is_unicode = 1; - } else if (((!s2_is_unicode) & (!s1_is_unicode))) { - return __Pyx_PyBytes_Equals(s1, s2, equals); - } -#endif - if (s1_is_unicode & s2_is_unicode) { - Py_ssize_t length; - int kind; - void *data1, *data2; - if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0)) - return -1; - length = __Pyx_PyUnicode_GET_LENGTH(s1); - if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { - goto return_ne; - } - kind = __Pyx_PyUnicode_KIND(s1); - if (kind != __Pyx_PyUnicode_KIND(s2)) { - goto return_ne; - } - data1 = __Pyx_PyUnicode_DATA(s1); - data2 = __Pyx_PyUnicode_DATA(s2); - if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { - goto return_ne; - } else if (length == 1) { - goto return_eq; - } else { - int result = memcmp(data1, data2, (size_t)(length * kind)); - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ) ? (result == 0) : (result != 0); - } - } else if ((s1 == Py_None) & s2_is_unicode) { - goto return_ne; - } else if ((s2 == Py_None) & s1_is_unicode) { - goto return_ne; - } else { - int result; - PyObject* py_result = PyObject_RichCompare(s1, s2, equals); - if (!py_result) - return -1; - result = __Pyx_PyObject_IsTrue(py_result); - Py_DECREF(py_result); - return result; - } -return_eq: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_EQ); -return_ne: - #if PY_MAJOR_VERSION < 3 - Py_XDECREF(owned_ref); - #endif - return (equals == Py_NE); -#endif -} - -/* PyObjectCall */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallMethO */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) { - PyObject *self, *result; - PyCFunction cfunc; - cfunc = PyCFunction_GET_FUNCTION(func); - self = PyCFunction_GET_SELF(func); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = cfunc(self, arg); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyObjectCallOneArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_New(1); - if (unlikely(!args)) return NULL; - Py_INCREF(arg); - PyTuple_SET_ITEM(args, 0, arg); - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) { - return __Pyx_PyObject_CallMethO(func, arg); - } - } - return __Pyx__PyObject_CallOneArg(func, arg); -} -#else -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) { - PyObject *result; - PyObject *args = PyTuple_Pack(1, arg); - if (unlikely(!args)) return NULL; - result = __Pyx_PyObject_Call(func, args, NULL); - Py_DECREF(args); - return result; -} -#endif - -/* PyObjectCallNoArg */ - #if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) { -#ifdef __Pyx_CyFunction_USED - if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) { -#else - if (likely(PyCFunction_Check(func))) { -#endif - if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) { - return __Pyx_PyObject_CallMethO(func, NULL); - } - } - return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL); -} -#endif - -/* CodeObjectCache */ - static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ - #include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntToPy */ - static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ - #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ - static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntFromPy */ - static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CheckBinaryVersion */ - static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* InitStrings */ - static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/tests/test_stlcontainers.py b/CXX/_yap/tests/test_stlcontainers.py deleted file mode 100644 index 841a96a87..000000000 --- a/CXX/_yap/tests/test_stlcontainers.py +++ /dev/null @@ -1,23 +0,0 @@ -"""Tests the part of stlconverters that is accessible from Python.""" -################### -### WARNING!!! ### -################### -# This file has been autogenerated -from __future__ import print_function -from unittest import TestCase -import nose - -from nose.tools import assert_equal, assert_not_equal, assert_raises, raises, \ - assert_almost_equal, assert_true, assert_false, assert_in - -from numpy.testing import assert_array_equal, assert_array_almost_equal - -import os -import numpy as np -from collections import Container, Mapping - -from _yap import stlcontainers - - -if __name__ == '__main__': - nose.run() diff --git a/CXX/_yap/xdress_extra_types.c b/CXX/_yap/xdress_extra_types.c deleted file mode 100644 index f996c0845..000000000 --- a/CXX/_yap/xdress_extra_types.c +++ /dev/null @@ -1,1962 +0,0 @@ -/* Generated by Cython 0.24.1 */ - -/* BEGIN: Cython Metadata -{ - "distutils": { - "depends": [ - "/Users/vsc/github/yap-6.3/CXX/_yap/xdress_extra_types.h" - ] - }, - "module_name": "_yap.xdress_extra_types" -} -END: Cython Metadata */ - -#define PY_SSIZE_T_CLEAN -#include "Python.h" -#ifndef Py_PYTHON_H - #error Python headers needed to compile C extensions, please install development version of Python. -#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000) - #error Cython requires Python 2.6+ or Python 3.2+. -#else -#define CYTHON_ABI "0_24_1" -#include -#ifndef offsetof - #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) -#endif -#if !defined(WIN32) && !defined(MS_WINDOWS) - #ifndef __stdcall - #define __stdcall - #endif - #ifndef __cdecl - #define __cdecl - #endif - #ifndef __fastcall - #define __fastcall - #endif -#endif -#ifndef DL_IMPORT - #define DL_IMPORT(t) t -#endif -#ifndef DL_EXPORT - #define DL_EXPORT(t) t -#endif -#ifndef PY_LONG_LONG - #define PY_LONG_LONG LONG_LONG -#endif -#ifndef Py_HUGE_VAL - #define Py_HUGE_VAL HUGE_VAL -#endif -#ifdef PYPY_VERSION - #define CYTHON_COMPILING_IN_PYPY 1 - #define CYTHON_COMPILING_IN_CPYTHON 0 -#else - #define CYTHON_COMPILING_IN_PYPY 0 - #define CYTHON_COMPILING_IN_CPYTHON 1 -#endif -#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000 - #define CYTHON_USE_PYLONG_INTERNALS 1 -#endif -#if CYTHON_USE_PYLONG_INTERNALS - #include "longintrepr.h" - #undef SHIFT - #undef BASE - #undef MASK -#endif -#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag) - #define Py_OptimizeFlag 0 -#endif -#define __PYX_BUILD_PY_SSIZE_T "n" -#define CYTHON_FORMAT_SSIZE_T "z" -#if PY_MAJOR_VERSION < 3 - #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyClass_Type -#else - #define __Pyx_BUILTIN_MODULE_NAME "builtins" - #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\ - PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) - #define __Pyx_DefaultClassType PyType_Type -#endif -#ifndef Py_TPFLAGS_CHECKTYPES - #define Py_TPFLAGS_CHECKTYPES 0 -#endif -#ifndef Py_TPFLAGS_HAVE_INDEX - #define Py_TPFLAGS_HAVE_INDEX 0 -#endif -#ifndef Py_TPFLAGS_HAVE_NEWBUFFER - #define Py_TPFLAGS_HAVE_NEWBUFFER 0 -#endif -#ifndef Py_TPFLAGS_HAVE_FINALIZE - #define Py_TPFLAGS_HAVE_FINALIZE 0 -#endif -#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) - #define CYTHON_PEP393_ENABLED 1 - #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\ - 0 : _PyUnicode_Ready((PyObject *)(op))) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) - #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) - #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) - #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u))) -#else - #define CYTHON_PEP393_ENABLED 0 - #define __Pyx_PyUnicode_READY(op) (0) - #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) - #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) - #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) - #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) - #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) - #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u)) -#endif -#if CYTHON_COMPILING_IN_PYPY - #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) -#else - #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) - #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\ - PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains) - #define PyUnicode_Contains(u, s) PySequence_Contains(u, s) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check) - #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format) - #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt) -#endif -#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc) - #define PyObject_Malloc(s) PyMem_Malloc(s) - #define PyObject_Free(p) PyMem_Free(p) - #define PyObject_Realloc(p) PyMem_Realloc(p) -#endif -#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) -#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) -#else - #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) -#endif -#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII) - #define PyObject_ASCII(o) PyObject_Repr(o) -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBaseString_Type PyUnicode_Type - #define PyStringObject PyUnicodeObject - #define PyString_Type PyUnicode_Type - #define PyString_Check PyUnicode_Check - #define PyString_CheckExact PyUnicode_CheckExact -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) - #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) -#else - #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj)) - #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) -#endif -#ifndef PySet_CheckExact - #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) -#endif -#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) -#if PY_MAJOR_VERSION >= 3 - #define PyIntObject PyLongObject - #define PyInt_Type PyLong_Type - #define PyInt_Check(op) PyLong_Check(op) - #define PyInt_CheckExact(op) PyLong_CheckExact(op) - #define PyInt_FromString PyLong_FromString - #define PyInt_FromUnicode PyLong_FromUnicode - #define PyInt_FromLong PyLong_FromLong - #define PyInt_FromSize_t PyLong_FromSize_t - #define PyInt_FromSsize_t PyLong_FromSsize_t - #define PyInt_AsLong PyLong_AsLong - #define PyInt_AS_LONG PyLong_AS_LONG - #define PyInt_AsSsize_t PyLong_AsSsize_t - #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask - #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask - #define PyNumber_Int PyNumber_Long -#endif -#if PY_MAJOR_VERSION >= 3 - #define PyBoolObject PyLongObject -#endif -#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY - #ifndef PyUnicode_InternFromString - #define PyUnicode_InternFromString(s) PyUnicode_FromString(s) - #endif -#endif -#if PY_VERSION_HEX < 0x030200A4 - typedef long Py_hash_t; - #define __Pyx_PyInt_FromHash_t PyInt_FromLong - #define __Pyx_PyInt_AsHash_t PyInt_AsLong -#else - #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t - #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t -#endif -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) -#else - #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass) -#endif -#if PY_VERSION_HEX >= 0x030500B1 -#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods -#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async) -#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 -typedef struct { - unaryfunc am_await; - unaryfunc am_aiter; - unaryfunc am_anext; -} __Pyx_PyAsyncMethodsStruct; -#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved)) -#else -#define __Pyx_PyType_AsAsync(obj) NULL -#endif -#ifndef CYTHON_RESTRICT - #if defined(__GNUC__) - #define CYTHON_RESTRICT __restrict__ - #elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define CYTHON_RESTRICT __restrict - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_RESTRICT restrict - #else - #define CYTHON_RESTRICT - #endif -#endif -#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None) - -#ifndef CYTHON_INLINE - #if defined(__GNUC__) - #define CYTHON_INLINE __inline__ - #elif defined(_MSC_VER) - #define CYTHON_INLINE __inline - #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define CYTHON_INLINE inline - #else - #define CYTHON_INLINE - #endif -#endif - -#if defined(WIN32) || defined(MS_WINDOWS) - #define _USE_MATH_DEFINES -#endif -#include -#ifdef NAN -#define __PYX_NAN() ((float) NAN) -#else -static CYTHON_INLINE float __PYX_NAN() { - float value; - memset(&value, 0xFF, sizeof(value)); - return value; -} -#endif -#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL) -#define __Pyx_truncl trunc -#else -#define __Pyx_truncl truncl -#endif - - -#define __PYX_ERR(f_index, lineno, Ln_error) \ -{ \ - __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \ -} - -#if PY_MAJOR_VERSION >= 3 - #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) -#else - #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) - #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) -#endif - -#ifndef __PYX_EXTERN_C - #ifdef __cplusplus - #define __PYX_EXTERN_C extern "C" - #else - #define __PYX_EXTERN_C extern - #endif -#endif - -#define __PYX_HAVE___yap__xdress_extra_types -#define __PYX_HAVE_API___yap__xdress_extra_types -#include "string.h" -#include "stdio.h" -#include "xdress_extra_types.h" -#ifdef _OPENMP -#include -#endif /* _OPENMP */ - -#ifdef PYREX_WITHOUT_ASSERTIONS -#define CYTHON_WITHOUT_ASSERTIONS -#endif - -#ifndef CYTHON_UNUSED -# if defined(__GNUC__) -# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) -# define CYTHON_UNUSED __attribute__ ((__unused__)) -# else -# define CYTHON_UNUSED -# endif -#endif -#ifndef CYTHON_NCP_UNUSED -# if CYTHON_COMPILING_IN_CPYTHON -# define CYTHON_NCP_UNUSED -# else -# define CYTHON_NCP_UNUSED CYTHON_UNUSED -# endif -#endif -typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding; - const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; - -#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 -#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 -#define __PYX_DEFAULT_STRING_ENCODING "" -#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString -#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#define __Pyx_uchar_cast(c) ((unsigned char)c) -#define __Pyx_long_cast(x) ((long)x) -#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\ - (sizeof(type) < sizeof(Py_ssize_t)) ||\ - (sizeof(type) > sizeof(Py_ssize_t) &&\ - likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX) &&\ - (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\ - v == (type)PY_SSIZE_T_MIN))) ||\ - (sizeof(type) == sizeof(Py_ssize_t) &&\ - (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\ - v == (type)PY_SSIZE_T_MAX))) ) -#if defined (__cplusplus) && __cplusplus >= 201103L - #include - #define __Pyx_sst_abs(value) std::abs(value) -#elif SIZEOF_INT >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) abs(value) -#elif SIZEOF_LONG >= SIZEOF_SIZE_T - #define __Pyx_sst_abs(value) labs(value) -#elif defined (_MSC_VER) && defined (_M_X64) - #define __Pyx_sst_abs(value) _abs64(value) -#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - #define __Pyx_sst_abs(value) llabs(value) -#elif defined (__GNUC__) - #define __Pyx_sst_abs(value) __builtin_llabs(value) -#else - #define __Pyx_sst_abs(value) ((value<0) ? -value : value) -#endif -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); -#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) -#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) -#define __Pyx_PyBytes_FromString PyBytes_FromString -#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); -#if PY_MAJOR_VERSION < 3 - #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize -#else - #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString - #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize -#endif -#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) -#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s) -#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s) -#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) -#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) -#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if PY_MAJOR_VERSION < 3 -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen -#endif -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode -#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode -#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) -#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) -#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False)) -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x); -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); -#if CYTHON_COMPILING_IN_CPYTHON -#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) -#else -#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) -#endif -#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) -#if PY_MAJOR_VERSION >= 3 -#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x)) -#else -#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x)) -#endif -#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x)) -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII -static int __Pyx_sys_getdefaultencoding_not_ascii; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - PyObject* ascii_chars_u = NULL; - PyObject* ascii_chars_b = NULL; - const char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - if (strcmp(default_encoding_c, "ascii") == 0) { - __Pyx_sys_getdefaultencoding_not_ascii = 0; - } else { - char ascii_chars[128]; - int c; - for (c = 0; c < 128; c++) { - ascii_chars[c] = c; - } - __Pyx_sys_getdefaultencoding_not_ascii = 1; - ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); - if (!ascii_chars_u) goto bad; - ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); - if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { - PyErr_Format( - PyExc_ValueError, - "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", - default_encoding_c); - goto bad; - } - Py_DECREF(ascii_chars_u); - Py_DECREF(ascii_chars_b); - } - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - Py_XDECREF(ascii_chars_u); - Py_XDECREF(ascii_chars_b); - return -1; -} -#endif -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) -#else -#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) -#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT -static char* __PYX_DEFAULT_STRING_ENCODING; -static int __Pyx_init_sys_getdefaultencoding_params(void) { - PyObject* sys; - PyObject* default_encoding = NULL; - char* default_encoding_c; - sys = PyImport_ImportModule("sys"); - if (!sys) goto bad; - default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); - Py_DECREF(sys); - if (!default_encoding) goto bad; - default_encoding_c = PyBytes_AsString(default_encoding); - if (!default_encoding_c) goto bad; - __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); - if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; - strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); - Py_DECREF(default_encoding); - return 0; -bad: - Py_XDECREF(default_encoding); - return -1; -} -#endif -#endif - - -/* Test for GCC > 2.95 */ -#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) - #define likely(x) __builtin_expect(!!(x), 1) - #define unlikely(x) __builtin_expect(!!(x), 0) -#else /* !__GNUC__ or GCC < 2.95 */ - #define likely(x) (x) - #define unlikely(x) (x) -#endif /* __GNUC__ */ - -static PyObject *__pyx_m; -static PyObject *__pyx_d; -static PyObject *__pyx_b; -static PyObject *__pyx_empty_tuple; -static PyObject *__pyx_empty_bytes; -static PyObject *__pyx_empty_unicode; -static int __pyx_lineno; -static int __pyx_clineno = 0; -static const char * __pyx_cfilenm= __FILE__; -static const char *__pyx_filename; - - -static const char *__pyx_f[] = { - "_yap/xdress_extra_types.pyx", -}; - -/* "_yap/xdress_extra_types.pxd":14 - * cdef void emit_endif "#endif //" () - * - * ctypedef unsigned char uchar # <<<<<<<<<<<<<< - * ctypedef long long int64 - * ctypedef unsigned short uint16 - */ -typedef unsigned char __pyx_t_4_yap_18xdress_extra_types_uchar; - -/* "_yap/xdress_extra_types.pxd":15 - * - * ctypedef unsigned char uchar - * ctypedef long long int64 # <<<<<<<<<<<<<< - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - */ -typedef PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_int64; - -/* "_yap/xdress_extra_types.pxd":16 - * ctypedef unsigned char uchar - * ctypedef long long int64 - * ctypedef unsigned short uint16 # <<<<<<<<<<<<<< - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - */ -typedef unsigned short __pyx_t_4_yap_18xdress_extra_types_uint16; - -/* "_yap/xdress_extra_types.pxd":17 - * ctypedef long long int64 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 # <<<<<<<<<<<<<< - * ctypedef unsigned long long uint64 - * ctypedef long double float128 - */ -typedef unsigned int __pyx_t_4_yap_18xdress_extra_types_uint32; - -/* "_yap/xdress_extra_types.pxd":18 - * ctypedef unsigned short uint16 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 # <<<<<<<<<<<<<< - * ctypedef long double float128 - * - */ -typedef unsigned PY_LONG_LONG __pyx_t_4_yap_18xdress_extra_types_uint64; - -/* "_yap/xdress_extra_types.pxd":19 - * ctypedef unsigned int uint32 - * ctypedef unsigned long long uint64 - * ctypedef long double float128 # <<<<<<<<<<<<<< - * - * cdef extern from "xdress_extra_types.h": - */ -typedef long double __pyx_t_4_yap_18xdress_extra_types_float128; - -/*--- Type declarations ---*/ - -/* --- Runtime support code (head) --- */ -/* Refnanny.proto */ -#ifndef CYTHON_REFNANNY - #define CYTHON_REFNANNY 0 -#endif -#if CYTHON_REFNANNY - typedef struct { - void (*INCREF)(void*, PyObject*, int); - void (*DECREF)(void*, PyObject*, int); - void (*GOTREF)(void*, PyObject*, int); - void (*GIVEREF)(void*, PyObject*, int); - void* (*SetupContext)(const char*, int, const char*); - void (*FinishContext)(void**); - } __Pyx_RefNannyAPIStruct; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; - static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); - #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; -#ifdef WITH_THREAD - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - if (acquire_gil) {\ - PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - PyGILState_Release(__pyx_gilstate_save);\ - } else {\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\ - } -#else - #define __Pyx_RefNannySetupContext(name, acquire_gil)\ - __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) -#endif - #define __Pyx_RefNannyFinishContext()\ - __Pyx_RefNanny->FinishContext(&__pyx_refnanny) - #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) - #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) - #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) - #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) - #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) -#else - #define __Pyx_RefNannyDeclarations - #define __Pyx_RefNannySetupContext(name, acquire_gil) - #define __Pyx_RefNannyFinishContext() - #define __Pyx_INCREF(r) Py_INCREF(r) - #define __Pyx_DECREF(r) Py_DECREF(r) - #define __Pyx_GOTREF(r) - #define __Pyx_GIVEREF(r) - #define __Pyx_XINCREF(r) Py_XINCREF(r) - #define __Pyx_XDECREF(r) Py_XDECREF(r) - #define __Pyx_XGOTREF(r) - #define __Pyx_XGIVEREF(r) -#endif -#define __Pyx_XDECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_XDECREF(tmp);\ - } while (0) -#define __Pyx_DECREF_SET(r, v) do {\ - PyObject *tmp = (PyObject *) r;\ - r = v; __Pyx_DECREF(tmp);\ - } while (0) -#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) -#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) - -/* PyObjectCall.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); -#else -#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) -#endif - -/* PyObjectGetAttrStr.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { - PyTypeObject* tp = Py_TYPE(obj); - if (likely(tp->tp_getattro)) - return tp->tp_getattro(obj, attr_name); -#if PY_MAJOR_VERSION < 3 - if (likely(tp->tp_getattr)) - return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); -#endif - return PyObject_GetAttr(obj, attr_name); -} -#else -#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) -#endif - -/* PyThreadStateGet.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate; -#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET(); -#else -#define __Pyx_PyThreadState_declare -#define __Pyx_PyThreadState_assign -#endif - -/* PyErrFetchRestore.proto */ -#if CYTHON_COMPILING_IN_CPYTHON -#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb) -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb); -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb); -#else -#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb) -#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb) -#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb) -#endif - -/* WriteUnraisableException.proto */ -static void __Pyx_WriteUnraisable(const char *name, int clineno, - int lineno, const char *filename, - int full_traceback, int nogil); - -/* CodeObjectCache.proto */ -typedef struct { - PyCodeObject* code_object; - int code_line; -} __Pyx_CodeObjectCacheEntry; -struct __Pyx_CodeObjectCache { - int count; - int max_count; - __Pyx_CodeObjectCacheEntry* entries; -}; -static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); -static PyCodeObject *__pyx_find_code_object(int code_line); -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); - -/* AddTraceback.proto */ -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename); - -/* CIntToPy.proto */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); - -/* CIntFromPy.proto */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); - -/* CIntFromPy.proto */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); - -/* CheckBinaryVersion.proto */ -static int __Pyx_check_binary_version(void); - -/* FunctionExport.proto */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig); - -/* InitStrings.proto */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); - - -/* Module declarations from 'libc.string' */ - -/* Module declarations from 'libc.stdio' */ - -/* Module declarations from '_yap.xdress_extra_types' */ -#define __Pyx_MODULE_NAME "_yap.xdress_extra_types" -int __pyx_module_is_main__yap__xdress_extra_types = 0; - -/* Implementation of '_yap.xdress_extra_types' */ -static const char __pyx_k_im[] = "im"; -static const char __pyx_k_re[] = "re"; -static const char __pyx_k_imag[] = "imag"; -static const char __pyx_k_main[] = "__main__"; -static const char __pyx_k_real[] = "real"; -static const char __pyx_k_test[] = "__test__"; -static PyObject *__pyx_n_s_im; -static PyObject *__pyx_n_s_imag; -static PyObject *__pyx_n_s_main; -static PyObject *__pyx_n_s_re; -static PyObject *__pyx_n_s_real; -static PyObject *__pyx_n_s_test; - -/* "_yap/xdress_extra_types.pyx":5 - * # - * - * cdef complex_t py2c_complex(object pyv): # <<<<<<<<<<<<<< - * cdef complex_t cv = complex_t(0, 0) - * pyv = complex(pyv) - */ - -static xd_complex_t __pyx_f_4_yap_18xdress_extra_types_py2c_complex(PyObject *__pyx_v_pyv) { - xd_complex_t __pyx_v_cv; - xd_complex_t __pyx_r; - __Pyx_RefNannyDeclarations - xd_complex_t __pyx_t_1; - PyObject *__pyx_t_2 = NULL; - PyObject *__pyx_t_3 = NULL; - double __pyx_t_4; - __Pyx_RefNannySetupContext("py2c_complex", 0); - __Pyx_INCREF(__pyx_v_pyv); - - /* "_yap/xdress_extra_types.pyx":6 - * - * cdef complex_t py2c_complex(object pyv): - * cdef complex_t cv = complex_t(0, 0) # <<<<<<<<<<<<<< - * pyv = complex(pyv) - * cv.re = pyv.real - */ - __pyx_t_1.re = 0.0; - __pyx_t_1.im = 0.0; - __pyx_v_cv = __pyx_t_1; - - /* "_yap/xdress_extra_types.pyx":7 - * cdef complex_t py2c_complex(object pyv): - * cdef complex_t cv = complex_t(0, 0) - * pyv = complex(pyv) # <<<<<<<<<<<<<< - * cv.re = pyv.real - * cv.im = pyv.imag - */ - __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_2); - __Pyx_INCREF(__pyx_v_pyv); - __Pyx_GIVEREF(__pyx_v_pyv); - PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_pyv); - __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)(&PyComplex_Type)), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; - __Pyx_DECREF_SET(__pyx_v_pyv, __pyx_t_3); - __pyx_t_3 = 0; - - /* "_yap/xdress_extra_types.pyx":8 - * cdef complex_t cv = complex_t(0, 0) - * pyv = complex(pyv) - * cv.re = pyv.real # <<<<<<<<<<<<<< - * cv.im = pyv.imag - * return cv - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyv, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 8, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_cv.re = __pyx_t_4; - - /* "_yap/xdress_extra_types.pyx":9 - * pyv = complex(pyv) - * cv.re = pyv.real - * cv.im = pyv.imag # <<<<<<<<<<<<<< - * return cv - * - */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_pyv, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_3); - __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 9, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; - __pyx_v_cv.im = __pyx_t_4; - - /* "_yap/xdress_extra_types.pyx":10 - * cv.re = pyv.real - * cv.im = pyv.imag - * return cv # <<<<<<<<<<<<<< - * - * - */ - __pyx_r = __pyx_v_cv; - goto __pyx_L0; - - /* "_yap/xdress_extra_types.pyx":5 - * # - * - * cdef complex_t py2c_complex(object pyv): # <<<<<<<<<<<<<< - * cdef complex_t cv = complex_t(0, 0) - * pyv = complex(pyv) - */ - - /* function exit code */ - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_2); - __Pyx_XDECREF(__pyx_t_3); - __Pyx_WriteUnraisable("_yap.xdress_extra_types.py2c_complex", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0); - __pyx_L0:; - __Pyx_XDECREF(__pyx_v_pyv); - __Pyx_RefNannyFinishContext(); - return __pyx_r; -} - -static PyMethodDef __pyx_methods[] = { - {0, 0, 0, 0} -}; - -#if PY_MAJOR_VERSION >= 3 -static struct PyModuleDef __pyx_moduledef = { - #if PY_VERSION_HEX < 0x03020000 - { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, - #else - PyModuleDef_HEAD_INIT, - #endif - "xdress_extra_types", - 0, /* m_doc */ - -1, /* m_size */ - __pyx_methods /* m_methods */, - NULL, /* m_reload */ - NULL, /* m_traverse */ - NULL, /* m_clear */ - NULL /* m_free */ -}; -#endif - -static __Pyx_StringTabEntry __pyx_string_tab[] = { - {&__pyx_n_s_im, __pyx_k_im, sizeof(__pyx_k_im), 0, 0, 1, 1}, - {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1}, - {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, - {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1}, - {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1}, - {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, - {0, 0, 0, 0, 0, 0, 0} -}; -static int __Pyx_InitCachedBuiltins(void) { - return 0; -} - -static int __Pyx_InitCachedConstants(void) { - __Pyx_RefNannyDeclarations - __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); - __Pyx_RefNannyFinishContext(); - return 0; -} - -static int __Pyx_InitGlobals(void) { - if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - return 0; - __pyx_L1_error:; - return -1; -} - -#if PY_MAJOR_VERSION < 3 -PyMODINIT_FUNC initxdress_extra_types(void); /*proto*/ -PyMODINIT_FUNC initxdress_extra_types(void) -#else -PyMODINIT_FUNC PyInit_xdress_extra_types(void); /*proto*/ -PyMODINIT_FUNC PyInit_xdress_extra_types(void) -#endif -{ - PyObject *__pyx_t_1 = NULL; - __Pyx_RefNannyDeclarations - #if CYTHON_REFNANNY - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); - if (!__Pyx_RefNanny) { - PyErr_Clear(); - __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); - if (!__Pyx_RefNanny) - Py_FatalError("failed to import 'refnanny' module"); - } - #endif - __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_xdress_extra_types(void)", 0); - if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error) - #ifdef __Pyx_CyFunction_USED - if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_FusedFunction_USED - if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Coroutine_USED - if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_Generator_USED - if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - #ifdef __Pyx_StopAsyncIteration_USED - if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - /*--- Library function declarations ---*/ - /*--- Threads initialization code ---*/ - #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS - #ifdef WITH_THREAD /* Python build with threading support? */ - PyEval_InitThreads(); - #endif - #endif - /*--- Module creation code ---*/ - #if PY_MAJOR_VERSION < 3 - __pyx_m = Py_InitModule4("xdress_extra_types", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); - #else - __pyx_m = PyModule_Create(&__pyx_moduledef); - #endif - if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error) - __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error) - Py_INCREF(__pyx_d); - __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error) - #if CYTHON_COMPILING_IN_PYPY - Py_INCREF(__pyx_b); - #endif - if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error); - /*--- Initialize various global constants etc. ---*/ - if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - if (__pyx_module_is_main__yap__xdress_extra_types) { - if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - } - #if PY_MAJOR_VERSION >= 3 - { - PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "_yap.xdress_extra_types")) { - if (unlikely(PyDict_SetItemString(modules, "_yap.xdress_extra_types", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error) - } - } - #endif - /*--- Builtin init code ---*/ - if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Constants init code ---*/ - if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Global init code ---*/ - /*--- Variable export code ---*/ - /*--- Function export code ---*/ - if (__Pyx_ExportFunction("py2c_complex", (void (*)(void))__pyx_f_4_yap_18xdress_extra_types_py2c_complex, "xd_complex_t (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error) - /*--- Type init code ---*/ - /*--- Type import code ---*/ - /*--- Variable import code ---*/ - /*--- Function import code ---*/ - /*--- Execution code ---*/ - #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED) - if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error) - #endif - - /* "_yap/xdress_extra_types.pyx":1 - * # # <<<<<<<<<<<<<< - * # This file has been autogenerated by xdress - * # - */ - __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_GOTREF(__pyx_t_1); - if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error) - __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; - - /*--- Wrapped vars code ---*/ - - goto __pyx_L0; - __pyx_L1_error:; - __Pyx_XDECREF(__pyx_t_1); - if (__pyx_m) { - if (__pyx_d) { - __Pyx_AddTraceback("init _yap.xdress_extra_types", __pyx_clineno, __pyx_lineno, __pyx_filename); - } - Py_DECREF(__pyx_m); __pyx_m = 0; - } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init _yap.xdress_extra_types"); - } - __pyx_L0:; - __Pyx_RefNannyFinishContext(); - #if PY_MAJOR_VERSION < 3 - return; - #else - return __pyx_m; - #endif -} - -/* --- Runtime support code --- */ -/* Refnanny */ -#if CYTHON_REFNANNY -static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { - PyObject *m = NULL, *p = NULL; - void *r = NULL; - m = PyImport_ImportModule((char *)modname); - if (!m) goto end; - p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); - if (!p) goto end; - r = PyLong_AsVoidPtr(p); -end: - Py_XDECREF(p); - Py_XDECREF(m); - return (__Pyx_RefNannyAPIStruct *)r; -} -#endif - -/* PyObjectCall */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { - PyObject *result; - ternaryfunc call = func->ob_type->tp_call; - if (unlikely(!call)) - return PyObject_Call(func, arg, kw); - if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) - return NULL; - result = (*call)(func, arg, kw); - Py_LeaveRecursiveCall(); - if (unlikely(!result) && unlikely(!PyErr_Occurred())) { - PyErr_SetString( - PyExc_SystemError, - "NULL result without error in PyObject_Call"); - } - return result; -} -#endif - -/* PyErrFetchRestore */ -#if CYTHON_COMPILING_IN_CPYTHON -static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) { - PyObject *tmp_type, *tmp_value, *tmp_tb; - tmp_type = tstate->curexc_type; - tmp_value = tstate->curexc_value; - tmp_tb = tstate->curexc_traceback; - tstate->curexc_type = type; - tstate->curexc_value = value; - tstate->curexc_traceback = tb; - Py_XDECREF(tmp_type); - Py_XDECREF(tmp_value); - Py_XDECREF(tmp_tb); -} -static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) { - *type = tstate->curexc_type; - *value = tstate->curexc_value; - *tb = tstate->curexc_traceback; - tstate->curexc_type = 0; - tstate->curexc_value = 0; - tstate->curexc_traceback = 0; -} -#endif - -/* WriteUnraisableException */ -static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno, - CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename, - int full_traceback, CYTHON_UNUSED int nogil) { - PyObject *old_exc, *old_val, *old_tb; - PyObject *ctx; - __Pyx_PyThreadState_declare -#ifdef WITH_THREAD - PyGILState_STATE state; - if (nogil) - state = PyGILState_Ensure(); -#ifdef _MSC_VER - else state = (PyGILState_STATE)-1; -#endif -#endif - __Pyx_PyThreadState_assign - __Pyx_ErrFetch(&old_exc, &old_val, &old_tb); - if (full_traceback) { - Py_XINCREF(old_exc); - Py_XINCREF(old_val); - Py_XINCREF(old_tb); - __Pyx_ErrRestore(old_exc, old_val, old_tb); - PyErr_PrintEx(1); - } - #if PY_MAJOR_VERSION < 3 - ctx = PyString_FromString(name); - #else - ctx = PyUnicode_FromString(name); - #endif - __Pyx_ErrRestore(old_exc, old_val, old_tb); - if (!ctx) { - PyErr_WriteUnraisable(Py_None); - } else { - PyErr_WriteUnraisable(ctx); - Py_DECREF(ctx); - } -#ifdef WITH_THREAD - if (nogil) - PyGILState_Release(state); -#endif -} - -/* CodeObjectCache */ -static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { - int start = 0, mid = 0, end = count - 1; - if (end >= 0 && code_line > entries[end].code_line) { - return count; - } - while (start < end) { - mid = start + (end - start) / 2; - if (code_line < entries[mid].code_line) { - end = mid; - } else if (code_line > entries[mid].code_line) { - start = mid + 1; - } else { - return mid; - } - } - if (code_line <= entries[mid].code_line) { - return mid; - } else { - return mid + 1; - } -} -static PyCodeObject *__pyx_find_code_object(int code_line) { - PyCodeObject* code_object; - int pos; - if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { - return NULL; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { - return NULL; - } - code_object = __pyx_code_cache.entries[pos].code_object; - Py_INCREF(code_object); - return code_object; -} -static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { - int pos, i; - __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; - if (unlikely(!code_line)) { - return; - } - if (unlikely(!entries)) { - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); - if (likely(entries)) { - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = 64; - __pyx_code_cache.count = 1; - entries[0].code_line = code_line; - entries[0].code_object = code_object; - Py_INCREF(code_object); - } - return; - } - pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); - if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { - PyCodeObject* tmp = entries[pos].code_object; - entries[pos].code_object = code_object; - Py_DECREF(tmp); - return; - } - if (__pyx_code_cache.count == __pyx_code_cache.max_count) { - int new_max = __pyx_code_cache.max_count + 64; - entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( - __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); - if (unlikely(!entries)) { - return; - } - __pyx_code_cache.entries = entries; - __pyx_code_cache.max_count = new_max; - } - for (i=__pyx_code_cache.count; i>pos; i--) { - entries[i] = entries[i-1]; - } - entries[pos].code_line = code_line; - entries[pos].code_object = code_object; - __pyx_code_cache.count++; - Py_INCREF(code_object); -} - -/* AddTraceback */ -#include "compile.h" -#include "frameobject.h" -#include "traceback.h" -static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( - const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyObject *py_srcfile = 0; - PyObject *py_funcname = 0; - #if PY_MAJOR_VERSION < 3 - py_srcfile = PyString_FromString(filename); - #else - py_srcfile = PyUnicode_FromString(filename); - #endif - if (!py_srcfile) goto bad; - if (c_line) { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #else - py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); - #endif - } - else { - #if PY_MAJOR_VERSION < 3 - py_funcname = PyString_FromString(funcname); - #else - py_funcname = PyUnicode_FromString(funcname); - #endif - } - if (!py_funcname) goto bad; - py_code = __Pyx_PyCode_New( - 0, - 0, - 0, - 0, - 0, - __pyx_empty_bytes, /*PyObject *code,*/ - __pyx_empty_tuple, /*PyObject *consts,*/ - __pyx_empty_tuple, /*PyObject *names,*/ - __pyx_empty_tuple, /*PyObject *varnames,*/ - __pyx_empty_tuple, /*PyObject *freevars,*/ - __pyx_empty_tuple, /*PyObject *cellvars,*/ - py_srcfile, /*PyObject *filename,*/ - py_funcname, /*PyObject *name,*/ - py_line, - __pyx_empty_bytes /*PyObject *lnotab*/ - ); - Py_DECREF(py_srcfile); - Py_DECREF(py_funcname); - return py_code; -bad: - Py_XDECREF(py_srcfile); - Py_XDECREF(py_funcname); - return NULL; -} -static void __Pyx_AddTraceback(const char *funcname, int c_line, - int py_line, const char *filename) { - PyCodeObject *py_code = 0; - PyFrameObject *py_frame = 0; - py_code = __pyx_find_code_object(c_line ? c_line : py_line); - if (!py_code) { - py_code = __Pyx_CreateCodeObjectForTraceback( - funcname, c_line, py_line, filename); - if (!py_code) goto bad; - __pyx_insert_code_object(c_line ? c_line : py_line, py_code); - } - py_frame = PyFrame_New( - PyThreadState_GET(), /*PyThreadState *tstate,*/ - py_code, /*PyCodeObject *code,*/ - __pyx_d, /*PyObject *globals,*/ - 0 /*PyObject *locals*/ - ); - if (!py_frame) goto bad; - py_frame->f_lineno = py_line; - PyTraceBack_Here(py_frame); -bad: - Py_XDECREF(py_code); - Py_XDECREF(py_frame); -} - -/* CIntToPy */ -static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; - if (is_unsigned) { - if (sizeof(long) < sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(unsigned long)) { - return PyLong_FromUnsignedLong((unsigned long) value); - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value); - } - } else { - if (sizeof(long) <= sizeof(long)) { - return PyInt_FromLong((long) value); - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - return PyLong_FromLongLong((PY_LONG_LONG) value); - } - } - { - int one = 1; int little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&value; - return _PyLong_FromByteArray(bytes, sizeof(long), - little, !is_unsigned); - } -} - -/* CIntFromPyVerify */ -#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0) -#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\ - __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1) -#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\ - {\ - func_type value = func_value;\ - if (sizeof(target_type) < sizeof(func_type)) {\ - if (unlikely(value != (func_type) (target_type) value)) {\ - func_type zero = 0;\ - if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\ - return (target_type) -1;\ - if (is_unsigned && unlikely(value < zero))\ - goto raise_neg_overflow;\ - else\ - goto raise_overflow;\ - }\ - }\ - return (target_type) value;\ - } - -/* CIntFromPy */ -static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { - const long neg_one = (long) -1, const_zero = (long) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(long) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (long) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0]) - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) { - return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) { - return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) { - return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (long) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(long) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (long) 0; - case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0]) - case -2: - if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(long) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(long) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(long) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) { - return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]))); - } - } - break; - } -#endif - if (sizeof(long) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x)) - } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - long val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (long) -1; - } - } else { - long val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (long) -1; - val = __Pyx_PyInt_As_long(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to long"); - return (long) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to long"); - return (long) -1; -} - -/* CIntFromPy */ -static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { - const int neg_one = (int) -1, const_zero = (int) 0; - const int is_unsigned = neg_one > const_zero; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_Check(x))) { - if (sizeof(int) < sizeof(long)) { - __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x)) - } else { - long val = PyInt_AS_LONG(x); - if (is_unsigned && unlikely(val < 0)) { - goto raise_neg_overflow; - } - return (int) val; - } - } else -#endif - if (likely(PyLong_Check(x))) { - if (is_unsigned) { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0]) - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) { - return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) { - return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) { - return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])); - } - } - break; - } -#endif -#if CYTHON_COMPILING_IN_CPYTHON - if (unlikely(Py_SIZE(x) < 0)) { - goto raise_neg_overflow; - } -#else - { - int result = PyObject_RichCompareBool(x, Py_False, Py_LT); - if (unlikely(result < 0)) - return (int) -1; - if (unlikely(result == 1)) - goto raise_neg_overflow; - } -#endif - if (sizeof(int) <= sizeof(unsigned long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x)) - } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x)) - } - } else { -#if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)x)->ob_digit; - switch (Py_SIZE(x)) { - case 0: return (int) 0; - case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0])) - case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0]) - case -2: - if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 2: - if (8 * sizeof(int) > 1 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -3: - if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 3: - if (8 * sizeof(int) > 2 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case -4: - if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - case 4: - if (8 * sizeof(int) > 3 * PyLong_SHIFT) { - if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) { - __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]))) - } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) { - return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]))); - } - } - break; - } -#endif - if (sizeof(int) <= sizeof(long)) { - __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x)) - } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) { - __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x)) - } - } - { -#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) - PyErr_SetString(PyExc_RuntimeError, - "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); -#else - int val; - PyObject *v = __Pyx_PyNumber_IntOrLong(x); - #if PY_MAJOR_VERSION < 3 - if (likely(v) && !PyLong_Check(v)) { - PyObject *tmp = v; - v = PyNumber_Long(tmp); - Py_DECREF(tmp); - } - #endif - if (likely(v)) { - int one = 1; int is_little = (int)*(unsigned char *)&one; - unsigned char *bytes = (unsigned char *)&val; - int ret = _PyLong_AsByteArray((PyLongObject *)v, - bytes, sizeof(val), - is_little, !is_unsigned); - Py_DECREF(v); - if (likely(!ret)) - return val; - } -#endif - return (int) -1; - } - } else { - int val; - PyObject *tmp = __Pyx_PyNumber_IntOrLong(x); - if (!tmp) return (int) -1; - val = __Pyx_PyInt_As_int(tmp); - Py_DECREF(tmp); - return val; - } -raise_overflow: - PyErr_SetString(PyExc_OverflowError, - "value too large to convert to int"); - return (int) -1; -raise_neg_overflow: - PyErr_SetString(PyExc_OverflowError, - "can't convert negative value to int"); - return (int) -1; -} - -/* CheckBinaryVersion */ -static int __Pyx_check_binary_version(void) { - char ctversion[4], rtversion[4]; - PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); - PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); - if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { - char message[200]; - PyOS_snprintf(message, sizeof(message), - "compiletime version %s of module '%.100s' " - "does not match runtime version %s", - ctversion, __Pyx_MODULE_NAME, rtversion); - return PyErr_WarnEx(NULL, message, 1); - } - return 0; -} - -/* FunctionExport */ -static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) { - PyObject *d = 0; - PyObject *cobj = 0; - union { - void (*fp)(void); - void *p; - } tmp; - d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__"); - if (!d) { - PyErr_Clear(); - d = PyDict_New(); - if (!d) - goto bad; - Py_INCREF(d); - if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0) - goto bad; - } - tmp.fp = f; -#if PY_VERSION_HEX >= 0x02070000 - cobj = PyCapsule_New(tmp.p, sig, 0); -#else - cobj = PyCObject_FromVoidPtrAndDesc(tmp.p, (void *)sig, 0); -#endif - if (!cobj) - goto bad; - if (PyDict_SetItemString(d, name, cobj) < 0) - goto bad; - Py_DECREF(cobj); - Py_DECREF(d); - return 0; -bad: - Py_XDECREF(cobj); - Py_XDECREF(d); - return -1; -} - -/* InitStrings */ -static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { - while (t->p) { - #if PY_MAJOR_VERSION < 3 - if (t->is_unicode) { - *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); - } else if (t->intern) { - *t->p = PyString_InternFromString(t->s); - } else { - *t->p = PyString_FromStringAndSize(t->s, t->n - 1); - } - #else - if (t->is_unicode | t->is_str) { - if (t->intern) { - *t->p = PyUnicode_InternFromString(t->s); - } else if (t->encoding) { - *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); - } else { - *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); - } - } else { - *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); - } - #endif - if (!*t->p) - return -1; - ++t; - } - return 0; -} - -static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { - return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { - Py_ssize_t ignore; - return __Pyx_PyObject_AsStringAndSize(o, &ignore); -} -static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { -#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) - if ( -#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - __Pyx_sys_getdefaultencoding_not_ascii && -#endif - PyUnicode_Check(o)) { -#if PY_VERSION_HEX < 0x03030000 - char* defenc_c; - PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); - if (!defenc) return NULL; - defenc_c = PyBytes_AS_STRING(defenc); -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - { - char* end = defenc_c + PyBytes_GET_SIZE(defenc); - char* c; - for (c = defenc_c; c < end; c++) { - if ((unsigned char) (*c) >= 128) { - PyUnicode_AsASCIIString(o); - return NULL; - } - } - } -#endif - *length = PyBytes_GET_SIZE(defenc); - return defenc_c; -#else - if (__Pyx_PyUnicode_READY(o) == -1) return NULL; -#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII - if (PyUnicode_IS_ASCII(o)) { - *length = PyUnicode_GET_LENGTH(o); - return PyUnicode_AsUTF8(o); - } else { - PyUnicode_AsASCIIString(o); - return NULL; - } -#else - return PyUnicode_AsUTF8AndSize(o, length); -#endif -#endif - } else -#endif -#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)) - if (PyByteArray_Check(o)) { - *length = PyByteArray_GET_SIZE(o); - return PyByteArray_AS_STRING(o); - } else -#endif - { - char* result; - int r = PyBytes_AsStringAndSize(o, &result, length); - if (unlikely(r < 0)) { - return NULL; - } else { - return result; - } - } -} -static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { - int is_true = x == Py_True; - if (is_true | (x == Py_False) | (x == Py_None)) return is_true; - else return PyObject_IsTrue(x); -} -static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) { - PyNumberMethods *m; - const char *name = NULL; - PyObject *res = NULL; -#if PY_MAJOR_VERSION < 3 - if (PyInt_Check(x) || PyLong_Check(x)) -#else - if (PyLong_Check(x)) -#endif - return __Pyx_NewRef(x); - m = Py_TYPE(x)->tp_as_number; -#if PY_MAJOR_VERSION < 3 - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Int(x); - } - else if (m && m->nb_long) { - name = "long"; - res = PyNumber_Long(x); - } -#else - if (m && m->nb_int) { - name = "int"; - res = PyNumber_Long(x); - } -#endif - if (res) { -#if PY_MAJOR_VERSION < 3 - if (!PyInt_Check(res) && !PyLong_Check(res)) { -#else - if (!PyLong_Check(res)) { -#endif - PyErr_Format(PyExc_TypeError, - "__%.4s__ returned non-%.4s (type %.200s)", - name, name, Py_TYPE(res)->tp_name); - Py_DECREF(res); - return NULL; - } - } - else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_TypeError, - "an integer is required"); - } - return res; -} -static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { - Py_ssize_t ival; - PyObject *x; -#if PY_MAJOR_VERSION < 3 - if (likely(PyInt_CheckExact(b))) { - if (sizeof(Py_ssize_t) >= sizeof(long)) - return PyInt_AS_LONG(b); - else - return PyInt_AsSsize_t(x); - } -#endif - if (likely(PyLong_CheckExact(b))) { - #if CYTHON_USE_PYLONG_INTERNALS - const digit* digits = ((PyLongObject*)b)->ob_digit; - const Py_ssize_t size = Py_SIZE(b); - if (likely(__Pyx_sst_abs(size) <= 1)) { - ival = likely(size) ? digits[0] : 0; - if (size == -1) ival = -ival; - return ival; - } else { - switch (size) { - case 2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -2: - if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -3: - if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case 4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - case -4: - if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) { - return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])); - } - break; - } - } - #endif - return PyLong_AsSsize_t(b); - } - x = PyNumber_Index(b); - if (!x) return -1; - ival = PyInt_AsSsize_t(x); - Py_DECREF(x); - return ival; -} -static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { - return PyInt_FromSize_t(ival); -} - - -#endif /* Py_PYTHON_H */ diff --git a/CXX/_yap/xdress_extra_types.h b/CXX/_yap/xdress_extra_types.h deleted file mode 100644 index 0cf40fd42..000000000 --- a/CXX/_yap/xdress_extra_types.h +++ /dev/null @@ -1,62 +0,0 @@ -/// \file extra_types.h -/// \author Anthony Scopatz (scopatz\@gmail.com) -/// -/// Provides some extra types that may be generally useful - -#if !defined(_XDRESS_EXTRA_TYPES_) -#define _XDRESS_EXTRA_TYPES_ - -#if defined(__cplusplus) -namespace xdress_extra_types -{ - /// complex type struct, matching PyTables definition -// typedef struct { -// double re; ///< real part -// double im; ///< imaginary part -// } complex_t; - - /// Chivalrously handles C++ memory issues that Cython does - /// not yet have a syntax for. This is a template class, - /// rather than three template functions, because Cython does - /// not yet support template function wrapping. - template - class MemoryKnight - { - public: - MemoryKnight(){}; ///< Default constructor - ~MemoryKnight(){}; ///< Default Destructor - - /// Creates a new instance of type T on the heap using - /// its default constructor. - /// \return T * - T * defnew(){return new T();}; - - /// Creates a new instance of type T, using T's default - /// constructor, at a given location. - /// \param void * ptr, location to create T instance - /// \return value of ptr recast as T * - T * renew(void * ptr){return new (ptr) T();}; - - /// Deallocates a location in memory using delete. - /// \param T * ptr, location to remove - void deall(T * ptr){delete ptr;}; - }; - -// End namespace xdress_extra_types -}; - -#elif defined(__STDC__) - -// de nada - -#endif - - -/// complex type struct, matching PyTables definition -typedef struct { - double re; ///< real part - double im; ///< imaginary part -} xd_complex_t; - -#endif - diff --git a/CXX/_yap/xdress_extra_types.pxd b/CXX/_yap/xdress_extra_types.pxd deleted file mode 100644 index 7cf783321..000000000 --- a/CXX/_yap/xdress_extra_types.pxd +++ /dev/null @@ -1,45 +0,0 @@ -"""C++ wrapper for extra types header.""" -from libc.stdio cimport FILE - -# Dirty ifdef, else, else preprocessor hack -# see http://comments.gmane.org/gmane.comp.python.cython.user/4080 -cdef extern from *: - cdef void emit_ifc "#if defined(__STDC__) //" () - cdef void emit_ifcpp "#if defined(__cplusplus) //" () - cdef void emit_elifc "#elif defined(__STDC__) //" () - cdef void emit_elifcpp "#elif defined(__cplusplus) //" () - cdef void emit_else "#else //" () - cdef void emit_endif "#endif //" () - -ctypedef unsigned char uchar -ctypedef long long int64 -ctypedef unsigned short uint16 -ctypedef unsigned int uint32 -ctypedef unsigned long long uint64 -ctypedef long double float128 - -cdef extern from "xdress_extra_types.h": - - ctypedef struct complex_t "xd_complex_t": - double re - double im - -cdef complex_t py2c_complex(object pyv) - -cdef extern from "Python.h": - - object PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE*)) - FILE* PyFile_AsFile(object p) - - -#emit_ifcpp() -#cdef extern from "" namespace "std": - -# cdef cppclass exception: -# exception() -# exception(const exception&) -# exception& operator= (const exception&) -# ~exception() -# const char * what() - -#emit_endif() diff --git a/CXX/_yap/xdress_extra_types.pyx b/CXX/_yap/xdress_extra_types.pyx deleted file mode 100644 index 2dc37cd1a..000000000 --- a/CXX/_yap/xdress_extra_types.pyx +++ /dev/null @@ -1,12 +0,0 @@ -# -# This file has been autogenerated by xdress -# - -cdef complex_t py2c_complex(object pyv): - cdef complex_t cv = complex_t(0, 0) - pyv = complex(pyv) - cv.re = pyv.real - cv.im = pyv.imag - return cv - - diff --git a/CXX/yapa.hh b/CXX/yapa.hh index 212d40492..c067fcc77 100644 --- a/CXX/yapa.hh +++ b/CXX/yapa.hh @@ -58,13 +58,13 @@ class YAPAtom { YAPAtom( Atom at ) { a = at; } public: /// construct new YAPAtom from UTF-8 string - YAPAtom( const char * s) { a = Yap_LookupAtom( s ); } + YAPAtom( const char * s) { a = Yap_LookupAtom( s ); } /// construct new YAPAtom from UTF-8 string - YAPAtom( const wchar_t * s) { CACHE_REGS a = UTF32ToAtom( s PASS_REGS ); } + YAPAtom( const wchar_t * s) { CACHE_REGS a = UTF32ToAtom( s PASS_REGS ); } /// construct new YAPAtom from wide string //YAPAtom( const wchar_t * s) { a = Yap_LookupMaybeWideAtom( s ); } /// construct new YAPAtom from max-length string -YAPAtom( const char * s, size_t len) { a = Yap_LookupAtomWithLength( s, len ); } + YAPAtom( const char * s, size_t len) { a = Yap_LookupAtomWithLength( s, len ); } /// get name of atom const char *getName(void); /// get name of (other way) @@ -89,10 +89,11 @@ class YAPProp { PropTag tag( Prop p ) { return (PropTag)(p->KindOfPE); } public: /// get name of property - virtual YAPAtom name() = 0; + // virtual YAPAtom name(); virtual ~YAPProp() {}; }; #endif /* YAPA_HH */ + diff --git a/CXX/yapdb.hh b/CXX/yapdb.hh index 8375ab9ef..984ead5d3 100644 --- a/CXX/yapdb.hh +++ b/CXX/yapdb.hh @@ -34,14 +34,14 @@ class YAPModule; */ class YAPModule : protected YAPAtomTerm { friend class YAPPredicate; + friend class YAPModuleProp; YAPModule(Term t) : YAPAtomTerm(t){}; Term t() { return gt(); } Term curModule() { CACHE_REGS return Yap_CurrentModule(); } public: - ~YAPModule(){}; - YAPModule() : YAPAtomTerm(curModule()){}; - YAPModule(YAPAtom t) : YAPAtomTerm(t){}; + YAPModule() : YAPAtomTerm(curModule()){}; + YAPModule(YAPAtom t) : YAPAtomTerm(t){}; }; /** @@ -54,12 +54,12 @@ class YAPModuleProp : public YAPProp { ModEntry *m; YAPModuleProp(ModEntry *mod) { m = mod; }; - YAPModuleProp(Term tmod) { m = Yap_GetModuleEntry(tmod); }; + YAPModuleProp(Term tmod) { m = Yap_GetModuleEntry(tmod); }; public: - YAPModuleProp() { CACHE_REGS m = Yap_GetModuleEntry(Yap_CurrentModule()); }; - YAPModuleProp(YAPModule tmod); - virtual YAPModule module() { return YAPModule(m->AtomOfME); }; + YAPModuleProp(YAPModule tmod) { m = Yap_GetModuleEntry(tmod.gt()); }; + YAPModuleProp() { CACHE_REGS m = Yap_GetModuleEntry(Yap_CurrentModule()); }; + virtual YAPModule module() { return YAPModule(m->AtomOfME); }; }; /** @@ -80,14 +80,14 @@ public: /// Constructor: receives name as an atom, plus arity /// /// This is the default method, and the most popular - YAPFunctor(YAPAtom at, uintptr_t arity) { f = Yap_MkFunctor(at.a, arity); } + YAPFunctor(YAPAtom at, uintptr_t arity) { f = Yap_MkFunctor(at.a, arity); } /// Constructor: receives name as a string plus arity /// /// Notice that this is designed for ISO-LATIN-1 right now /// Note: Python confuses the 3 constructors, /// use YAPFunctorFromString - inline YAPFunctor(const char *s, uintptr_t arity, bool isutf8 = true) { + inline YAPFunctor(const char *s, uintptr_t arity, bool isutf8 = true) { f = Yap_MkFunctor(Yap_LookupAtom(s), arity); } /// Constructor: receives name as a wide string plus arity @@ -96,19 +96,18 @@ public: /// /// Note: Python confuses the 3 constructors, /// use YAPFunctorFromWideString - inline YAPFunctor(const wchar_t *s, uintptr_t arity) { + inline YAPFunctor(const wchar_t *s, uintptr_t arity) { CACHE_REGS f = Yap_MkFunctor(UTF32ToAtom(s PASS_REGS), arity); } - ~YAPFunctor(){}; /// Getter: extract name of functor as an atom /// /// this is for external usage. - YAPAtom name(void) { return YAPAtom(NameOfFunctor(f)); } + YAPAtom name(void) { return YAPAtom(NameOfFunctor(f)); } /// Getter: extract arity of functor as an unsigned integer /// /// this is for external usage. - uintptr_t arity(void) { return ArityOfFunctor(f); } + uintptr_t arity(void) { return ArityOfFunctor(f); } }; /** @@ -133,12 +132,14 @@ protected: /// It also communicates the array of arguments t[] /// and the array of variables /// back to yapquery - YAPPredicate(const char *s0, Term &out, Term &names) { + YAPPredicate(const char *s0, Term &out, Term &names) { CACHE_REGS BACKUP_MACHINE_REGS(); Term *modp = NULL; - - out = Yap_StringToTerm(s0, strlen(s0) + 1, &LOCAL_encoding, 1200, names); +names = MkVarTerm (); + const unsigned char *us = (const unsigned char *)s0; + out = + Yap_BufferToTermWithPrioBindings(us, strlen(s0), TermNil, 1200, names); // extern char *s0; // fprintf(stderr,"ap=%p arity=%d text=%s", ap, ap->ArityOfPE, s); // Yap_DebugPlWrite(out); @@ -153,7 +154,7 @@ protected: /// Term constructor for predicates /// /// It is just a call to getPred - inline YAPPredicate(Term t) { + inline YAPPredicate(Term t) { CELL *v = NULL; ap = getPred(t, v); } @@ -173,35 +174,34 @@ protected: inline YAPPredicate(PredEntry *pe) { ap = pe; } public: - ~YAPPredicate(){}; /// Functor constructor for predicates /// /// Asssumes that we use the current module. - YAPPredicate(YAPFunctor f) { + YAPPredicate(YAPFunctor f) { CACHE_REGS ap = RepPredProp(PredPropByFunc(f.f, Yap_CurrentModule())); } /// Functor constructor for predicates, is given a specific module. /// - inline YAPPredicate(YAPFunctor f, YAPTerm mod) { + inline YAPPredicate(YAPFunctor f, YAPTerm mod) { ap = RepPredProp(PredPropByFunc(f.f, mod.t)); } /// Name/arity constructor for predicates. /// - inline YAPPredicate(YAPAtom at, YAPTerm mod) { + inline YAPPredicate(YAPAtom at, YAPTerm mod) { ap = RepPredProp(PredPropByAtom(at.a, mod.t)); } /// Name/0 constructor for predicates. /// - YAPPredicate(YAPAtom at); + YAPPredicate(YAPAtom at); /// Mod:Name/Arity constructor for predicates. /// - inline YAPPredicate(YAPAtom at, uintptr_t arity, YAPModule mod) { + inline YAPPredicate(YAPAtom at, uintptr_t arity, YAPModule mod) { if (arity) { Functor f = Yap_MkFunctor(at.a, arity); ap = RepPredProp(PredPropByFunc(f, mod.t())); @@ -212,30 +212,32 @@ public: /// Atom/Arity constructor for predicates. /// - YAPPredicate(YAPAtom at, uintptr_t arity); + YAPPredicate(YAPAtom at, uintptr_t arity); /// char */module constructor for predicates. /// - inline YAPPredicate(const char *at, uintptr_t arity) { - ap = RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom(at), arity), CurrentModule)); + inline YAPPredicate(const char *at, uintptr_t arity) { + ap = RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom(at), arity), + CurrentModule)); }; /// char */module constructor for predicates. /// - inline YAPPredicate(const char *at, uintptr_t arity, YAPTerm mod) { - ap = RepPredProp(PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom(at), arity), mod.t)); + inline YAPPredicate(const char *at, uintptr_t arity, YAPTerm mod) { + ap = RepPredProp( + PredPropByFunc(Yap_MkFunctor(Yap_LookupAtom(at), arity), mod.t)); }; /// char */module constructor for predicates. /// - inline YAPPredicate(const char *at, YAPTerm mod) { + inline YAPPredicate(const char *at, YAPTerm mod) { ap = RepPredProp(PredPropByAtom(Yap_LookupAtom(at), mod.t)); } /// module of a predicate /// /// notice that modules are currently treated as atoms, this should change. - YAPModule module() { + YAPModule module() { if (ap->ModuleOfPred == PROLOG_MODULE) return YAPModule(AtomProlog); else @@ -252,6 +254,15 @@ public: return YAPAtom(NameOfFunctor(ap->FunctorOfPred)); } + /// functor of predicate + /// + /// onlu defined if arity >= 1 + YAPFunctor functor() { + if (ap->ArityOfPE) + return YAPFunctor(ap->FunctorOfPred); + return NULL; + } + /// arity of predicate /// /// we return a positive number. @@ -266,15 +277,15 @@ public: */ class YAPPrologPredicate : public YAPPredicate { public: - YAPPrologPredicate(YAPTerm t) : YAPPredicate(t) {}; - YAPPrologPredicate(const char *s, arity_t arity): YAPPredicate(s, arity) {}; + YAPPrologPredicate(YAPTerm t) : YAPPredicate(t){}; + YAPPrologPredicate(const char *s, arity_t arity) : YAPPredicate(s, arity){}; /// add a new clause - void *assertClause(YAPTerm clause, bool last = true, + bool assertClause(YAPTerm clause, bool last = true, YAPTerm source = YAPTerm()); /// add a new tuple - void *assertFact(YAPTerm *tuple, bool last = true); + bool assertFact(YAPTerm *tuple, bool last = true); /// retract at least the first clause matching the predicate. - void *retractClause(YAPTerm skeleton, bool all = false); + void *retractClause(YAPTerm skeleton, bool all = false); /// return the Nth clause (if source is available) // YAPTerm clause(size_t index, YAPPredicate p) { return YAPTerm(); }; /// return the Nth clause (if source is available) @@ -303,7 +314,7 @@ public: } } }; - YAPFLIP(const char *name, uintptr_t arity, YAPModule module = YAPModule(), + YAPFLIP(const char *name, uintptr_t arity, YAPModule module = YAPModule(), bool backtrackable = false) : YAPPredicate(YAPAtom(name), arity, module) { if (backtrackable) { @@ -312,8 +323,8 @@ public: YAP_UserCPredicate(name, 0, arity); } }; - bool addCall(CPredicate call) { return Yap_AddCallToFli(ap, call); } - bool addRetry(CPredicate call) { return Yap_AddRetryToFli(ap, call); } + bool addCall(CPredicate call) { return Yap_AddCallToFli(ap, call); } + bool addRetry(CPredicate call) { return Yap_AddRetryToFli(ap, call); } bool addCut(CPredicate call) { return Yap_AddCutToFli(ap, call); } }; diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 180a89b3f..927b59adb 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -2,8 +2,6 @@ #define YAP_CPP_INTERFACE 1 #include "yapi.hh" -#include - extern "C" { #if __ANDROID__ @@ -23,7 +21,8 @@ X_API void YAP_UserBackCPredicate(const char *, YAP_UserCPred, YAP_UserCPred, arity_t, arity_t); } -YAPAtomTerm::YAPAtomTerm(char *s) { // build string +YAPAtomTerm::YAPAtomTerm(char *s) +{ // build string BACKUP_H(); CACHE_REGS @@ -38,7 +37,8 @@ YAPAtomTerm::YAPAtomTerm(char *s) { // build string RECOVER_H(); } -YAPAtomTerm::YAPAtomTerm(char *s, size_t len) { // build string +YAPAtomTerm::YAPAtomTerm(char *s, size_t len) +{ // build string BACKUP_H(); CACHE_REGS @@ -54,7 +54,8 @@ YAPAtomTerm::YAPAtomTerm(char *s, size_t len) { // build string RECOVER_H(); } -YAPAtomTerm::YAPAtomTerm(wchar_t *s) : YAPTerm() { // build string +YAPAtomTerm::YAPAtomTerm(wchar_t *s) : YAPTerm() +{ // build string BACKUP_H(); CACHE_REGS @@ -69,7 +70,8 @@ YAPAtomTerm::YAPAtomTerm(wchar_t *s) : YAPTerm() { // build string RECOVER_H(); } -YAPAtomTerm::YAPAtomTerm(wchar_t *s, size_t len) : YAPTerm() { // build string +YAPAtomTerm::YAPAtomTerm(wchar_t *s, size_t len) : YAPTerm() +{ // build string BACKUP_H(); CACHE_REGS @@ -85,7 +87,8 @@ YAPAtomTerm::YAPAtomTerm(wchar_t *s, size_t len) : YAPTerm() { // build string RECOVER_H(); } -YAPStringTerm::YAPStringTerm(char *s) { // build string +YAPStringTerm::YAPStringTerm(char *s) +{ // build string BACKUP_H(); CACHE_REGS @@ -100,7 +103,8 @@ YAPStringTerm::YAPStringTerm(char *s) { // build string RECOVER_H(); } -YAPStringTerm::YAPStringTerm(char *s, size_t len) { // build string +YAPStringTerm::YAPStringTerm(char *s, size_t len) +{ // build string BACKUP_H(); CACHE_REGS @@ -117,7 +121,8 @@ YAPStringTerm::YAPStringTerm(char *s, size_t len) { // build string RECOVER_H(); } -YAPStringTerm::YAPStringTerm(wchar_t *s) : YAPTerm() { // build string +YAPStringTerm::YAPStringTerm(wchar_t *s) : YAPTerm() +{ // build string BACKUP_H(); CACHE_REGS @@ -134,7 +139,8 @@ YAPStringTerm::YAPStringTerm(wchar_t *s) : YAPTerm() { // build string } YAPStringTerm::YAPStringTerm(wchar_t *s, size_t len) - : YAPTerm() { // build string + : YAPTerm() +{ // build string BACKUP_H(); CACHE_REGS @@ -151,7 +157,8 @@ YAPStringTerm::YAPStringTerm(wchar_t *s, size_t len) RECOVER_H(); } -YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) : YAPTerm() { +YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) : YAPTerm() +{ BACKUP_H(); arity_t arity = ArityOfFunctor(f.f); Term *tt = new Term[arity]; @@ -162,18 +169,20 @@ YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) : YAPTerm() { RECOVER_H(); } -YAPApplTerm::YAPApplTerm(const char *f, std::vector ts) : YAPTerm() { +YAPApplTerm::YAPApplTerm(std::string f, std::vector ts) : YAPTerm() +{ BACKUP_H(); arity_t arity = ts.size(); std::vector tt(arity); for (arity_t i = 0; i < arity; i++) tt[i] = ts[i].term(); - Functor ff = Yap_MkFunctor(Yap_LookupAtom(f), arity); + Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity); t = Yap_MkApplTerm(ff, arity, &tt[0]); RECOVER_H(); } -YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() { +YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() +{ BACKUP_H(); arity_t arity = ArityOfFunctor(f.f); mk(Yap_MkNewApplTerm(f.f, arity)); @@ -182,65 +191,77 @@ YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() { YAPFunctor YAPApplTerm::getFunctor() { return YAPFunctor(FunctorOfTerm(gt())); } -YAPTerm &YAPTerm::operator[](arity_t i) { +Term &YAPTerm::operator[](arity_t i) +{ BACKUP_MACHINE_REGS(); Term t0 = gt(); Term tf = 0; - if (IsApplTerm(t0)) { - Functor f = FunctorOfTerm(t0); - if (IsExtensionFunctor(f)) - return *new YAPTerm(); - tf = ArgOfTerm(i + 1, t0); - } else if (IsPairTerm(t0)) { + if (IsApplTerm(t0)) + { + // Functor f = FunctorOfTerm(t0); + // if (IsExtensionFunctor(f)) + // return 0; + tf = RepAppl(t0)[(i + 1)]; + } + else if (IsPairTerm(t0)) + { if (i == 0) tf = HeadOfTerm(t0); else if (i == 1) tf = TailOfTerm(t0); + RECOVER_MACHINE_REGS(); + tf = RepPair(tf)[i]; } RECOVER_MACHINE_REGS(); - return *new YAPTerm(tf); + Yap_Error(TYPE_ERROR_COMPOUND, tf, ""); + throw YAPError(); } -YAPTerm &YAPListTerm::operator[](arity_t i) { +Term &YAPListTerm::operator[](arity_t i) +{ BACKUP_MACHINE_REGS(); Term t0 = gt(); Term tf = 0; - while (IsPairTerm(t0)) { - if (i == 0) { + while (IsPairTerm(t0)) + { + if (i == 0) + { tf = HeadOfTerm(t0); break; - } else { + } + else + { t0 = TailOfTerm(t0); i--; } } RECOVER_MACHINE_REGS(); - return *new YAPTerm(tf); + return RepPair(tf)[i]; } -YAPPairTerm::YAPPairTerm(YAPTerm th, YAPTerm tl) : YAPTerm() { +YAPPairTerm::YAPPairTerm(YAPTerm th, YAPTerm tl) : YAPTerm() +{ CACHE_REGS BACKUP_H(); mk(MkPairTerm(th.term(), tl.term())); RECOVER_H(); } -YAPPairTerm::YAPPairTerm() : YAPTerm() { +YAPPairTerm::YAPPairTerm() : YAPTerm() +{ BACKUP_H(); t = Yap_MkNewPairTerm(); RECOVER_H(); } -Term YAPTerm::gt() { CACHE_REGS return Yap_GetFromSlot(t); } - -void YAPTerm::mk(Term t0) { CACHE_REGS t= Yap_InitSlot(t0); } - - -YAP_tag_t YAPTerm::tag() { +YAP_tag_t YAPTerm::tag() +{ Term tt = gt(); - if (IsVarTerm(tt)) { + if (IsVarTerm(tt)) + { CELL *pt = VarOfTerm(tt); - if (IsUnboundVar(pt)) { + if (IsUnboundVar(pt)) + { CACHE_REGS if (IsAttVar(pt)) return YAP_TAG_ATT; @@ -250,23 +271,31 @@ YAP_tag_t YAPTerm::tag() { } if (IsPairTerm(tt)) return YAP_TAG_PAIR; - if (IsAtomOrIntTerm(tt)) { + if (IsAtomOrIntTerm(tt)) + { if (IsAtomTerm(tt)) return YAP_TAG_ATOM; return YAP_TAG_INT; - } else { + } + else + { Functor f = FunctorOfTerm(tt); - if (IsExtensionFunctor(f)) { - if (f == FunctorDBRef) { + if (IsExtensionFunctor(f)) + { + if (f == FunctorDBRef) + { return YAP_TAG_DBREF; } - if (f == FunctorLongInt) { + if (f == FunctorLongInt) + { return YAP_TAG_LONG_INT; } - if (f == FunctorBigInt) { + if (f == FunctorBigInt) + { big_blob_type bt = (big_blob_type)RepAppl(tt)[1]; - switch (bt) { + switch (bt) + { case BIG_INT: return YAP_TAG_BIG_INT; case BIG_RATIONAL: @@ -280,27 +309,30 @@ YAP_tag_t YAPTerm::tag() { } } -YAPTerm YAPTerm::deepCopy() { +Term YAPTerm::deepCopy() +{ yhandle_t tn; BACKUP_MACHINE_REGS(); tn = Yap_CopyTerm(gt()); RECOVER_MACHINE_REGS(); - return *new YAPTerm(tn); + return (tn); } -YAPListTerm YAPListTerm::dup() { +Term YAPListTerm::dup() +{ yhandle_t tn; BACKUP_MACHINE_REGS(); tn = Yap_CopyTerm(gt()); RECOVER_MACHINE_REGS(); - return *new YAPListTerm(tn); + return tn; } -intptr_t YAPTerm::numberVars(intptr_t i0, bool skip_singletons) { +intptr_t YAPTerm::numberVars(intptr_t i0, bool skip_singletons) +{ BACKUP_MACHINE_REGS(); intptr_t i = Yap_NumberVars(gt(), i0, skip_singletons); @@ -309,79 +341,10 @@ intptr_t YAPTerm::numberVars(intptr_t i0, bool skip_singletons) { return i; } -bool YAPTerm::exactlyEqual(YAPTerm t1) { - bool out; - BACKUP_MACHINE_REGS(); +const char *YAPQuery::text() { return YAPTerm(goal).text(); } - out = Yap_eq(gt(), t1.term()); - - RECOVER_MACHINE_REGS(); - return out; -} - -bool YAPTerm::unify(YAPTerm t1) { - intptr_t out; - BACKUP_MACHINE_REGS(); - - out = Yap_unify(gt(), t1.term()); - - RECOVER_MACHINE_REGS(); - return out; -} - -bool YAPTerm::unifiable(YAPTerm t1) { - intptr_t out; - BACKUP_MACHINE_REGS(); - - out = Yap_Unifiable(gt(), t1.term()); - - RECOVER_MACHINE_REGS(); - return out; -} - -bool YAPTerm::variant(YAPTerm t1) { - intptr_t out; - BACKUP_MACHINE_REGS(); - - out = Yap_Variant(gt(), t1.term()); - - RECOVER_MACHINE_REGS(); - return out; -} - -intptr_t YAPTerm::hashTerm(size_t sz, size_t depth, bool variant) { - intptr_t out; - - BACKUP_MACHINE_REGS(); - - out = Yap_TermHash(gt(), sz, depth, variant); - - RECOVER_MACHINE_REGS(); - return out; -} - -const char *YAPTerm::text() { - CACHE_REGS - size_t length = 0; - encoding_t enc = LOCAL_encoding; - char *os; - - BACKUP_MACHINE_REGS(); - if (!(os = Yap_TermToString(Yap_GetFromSlot(t), &length, enc, - Handle_vars_f))) { - RECOVER_MACHINE_REGS(); - return 0; - } - RECOVER_MACHINE_REGS(); - length = strlen(os) + 1; - char *sm = (char *)malloc(length + 1); - strcpy(sm, os); - return sm; -} - -const char *YAPQuery::text() { return goal.text(); } - -YAPIntegerTerm::YAPIntegerTerm(intptr_t i) { +YAPIntegerTerm::YAPIntegerTerm(intptr_t i) +{ CACHE_REGS Term tn = MkIntegerTerm(i); mk(tn); } @@ -397,340 +360,391 @@ YAPTerm *YAPTerm::vars() } */ -YAPTerm::YAPTerm(void *ptr) { +YAPTerm::YAPTerm(void *ptr) +{ CACHE_REGS mk(MkIntegerTerm((Int)ptr)); } -YAPTerm YAPListTerm::car() { +Term YAPListTerm::car() +{ Term to = gt(); if (IsPairTerm(to)) - return YAPTerm(HeadOfTerm(to)); - else { + return (HeadOfTerm(to)); + else + { Yap_Error(TYPE_ERROR_LIST, to, ""); throw YAPError(); } } - -YAPListTerm::YAPListTerm(YAPTerm ts[], arity_t n) { +YAPListTerm::YAPListTerm(YAPTerm ts[], arity_t n) +{ CACHE_REGS BACKUP_H(); if (n == 0) t = TermNil; - while (HR + n * 2 > ASP - 1024) { + while (HR + n * 2 > ASP - 1024) + { RECOVER_H(); - if (!Yap_dogc(0, NULL PASS_REGS)) { + if (!Yap_dogc(0, NULL PASS_REGS)) + { t = TermNil; } BACKUP_H(); } t = AbsPair(HR); - for (arity_t i = 0; i < n; i++) { + for (arity_t i = 0; i < n; i++) + { HR[2 * i] = ts[i].gt(); HR[2 * i + 1] = AbsPair(HR + (2 * i + 2)); } } -YAPVarTerm::YAPVarTerm() { +YAPVarTerm::YAPVarTerm() +{ CACHE_REGS mk(MkVarTerm()); } -const char *YAPAtom::getName(void) { - return Yap_AtomToUTF8Text( a, nullptr ); -} +const char *YAPAtom::getName(void) { return Yap_AtomToUTF8Text(a, nullptr); } - - - - void YAPQuery::openQuery() { - CACHE_REGS - arity_t arity = ap->ArityOfPE; - if (arity) { - Term *ts; - Term t = goal.term(); - if (IsPairTerm(t)) { - ts = RepPair(t); - } else { - ts = RepAppl(t) + 1; - } - for (arity_t i = 0; i < arity; i++) { - XREGS[i + 1] = ts[i]; - } - } - // oq = LOCAL_execution; - // LOCAL_execution = this; - q_open = true; - q_state = 0; - q_flags = true; // PL_Q_PASS_EXCEPTION; - - q_p = P; - q_cp = CP; - // make sure this is safe - q_handles = Yap_StartSlots(); - } - - -bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]) { +void YAPQuery::openQuery() +{ CACHE_REGS - BACKUP_MACHINE_REGS(); - arity_t arity = ap.getArity(); - bool result; - YAP_dogoalinfo q; - Term terr; - jmp_buf q_env; - - for (arity_t i = 0; i < arity; i++) - XREGS[i + 1] = ts[i].term(); - q.CurSlot = Yap_StartSlots(); - q.p = P; - q.cp = CP; - // make sure this is safe - if (setjmp(q_env)) { - if ((terr = Yap_PeekException())) { - YAP_LeaveGoal(false, &q); - Yap_CloseHandles(q.CurSlot); - throw YAPError(); - } - return false; - } - // don't forget, on success these bindings will still be there); - YAP_LeaveGoal(false, &q); - RECOVER_MACHINE_REGS(); - return result; -} - -bool YAPEngine::goalt(YAPTerm Yt) { - return Yt.term(); - } - - -bool YAPEngine::goal(Term t) { - CACHE_REGS - BACKUP_MACHINE_REGS(); - Term terr, tmod = CurrentModule, *ts = nullptr; - PredEntry *ap = Yap_get_pred(t, tmod, "C++"); arity_t arity = ap->ArityOfPE; - bool result; - jmp_buf q_env; - - if (IsApplTerm(t)) { - ts = RepAppl(t) + 1; - } else { - ts = RepPair(t); - } - for (arity_t i = 0; i < arity; i++) - XREGS[i + 1] = ts[i]; - q.CurSlot = Yap_StartSlots(); - q.p = P; - q.cp = CP; - // make sure this is safe - - if (setjmp(q_env)) { - if ((terr = Yap_PeekException())) { - YAP_LeaveGoal(false, &q); - Yap_CloseHandles(q.CurSlot); - throw YAPError(); + if (arity) + { + Term *ts; + Term t = goal; + if (IsPairTerm(t)) + { + ts = RepPair(t); + } + else + { + ts = RepAppl(t) + 1; + } + for (arity_t i = 0; i < arity; i++) + { + XREGS[i + 1] = ts[i]; } - return false; } - // don't forget, on success these guys may create slots - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + // oq = LOCAL_execution; + // LOCAL_execution = this; + q_open = true; + q_state = 0; + q_flags = true; // PL_Q_PASS_EXCEPTION; - - result = (bool)YAP_EnterGoal(ap, nullptr, &q); - if ((terr = Yap_GetException())) { - YAP_LeaveGoal(false, &q); - throw YAPError(); - } - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "out %d", result); - - if (!result) { - YAP_LeaveGoal(false, &q); - } else { - YAP_LeaveGoal(FALSE, &q); - } - RECOVER_MACHINE_REGS(); - return result; + q_p = P; + q_cp = CP; + // make sure this is safe + q_handles = Yap_StartSlots(); } -void YAPEngine::release() { +bool YAPEngine::call(YAPPredicate ap, YAPTerm ts[]) +{ + try + { + CACHE_REGS + if (ap.ap == NULL) + return false; + BACKUP_MACHINE_REGS(); + arity_t arity = ap.getArity(); + bool result; + YAP_dogoalinfo q; + sigjmp_buf q_env; - BACKUP_MACHINE_REGS(); - YAP_LeaveGoal(FALSE, &q); - RECOVER_MACHINE_REGS(); - } - -Term YAPEngine::fun(Term t) { - CACHE_REGS - BACKUP_MACHINE_REGS(); - Term tmod = CurrentModule, *ts = nullptr; - PredEntry *ap ; - arity_t arity; - Functor f; - jmp_buf q_env; - Atom name; - - - BACKUP_MACHINE_REGS(); - if (IsApplTerm(t)) { - ts = RepAppl(t) + 1; - f = (Functor)ts[-1]; - name = NameOfFunctor(f); - arity =ArityOfFunctor(f); for (arity_t i = 0; i < arity; i++) - XREGS[i + 1] = ts[i]; - } else if (IsAtomTerm(t)) { - name = AtomOfTerm(t); - f = nullptr; - arity = 0; - } else if (IsPairTerm(t)) { - XREGS[1] = ts[0]; - XREGS[2] = ts[1]; - arity = 2; - name = AtomDot; - f = FunctorDot; - } else { - Yap_Error(TYPE_ERROR_CALLABLE, t, 0); - return 0L; - } - XREGS[arity+1] = MkVarTerm(); - arity ++; - f = Yap_MkFunctor(name,arity); - ap = (PredEntry *)(PredPropByFunc(f,tmod)); - q.CurSlot = Yap_StartSlots(); - q.p = P; - q.cp = CP; - // make sure this is safe - yhandle_t o = Yap_InitHandle(XREGS[arity]); - - if (setjmp(q_env)) { - Term terr; - if ((terr = Yap_PeekException())) { - YAP_LeaveGoal(false, &q); - Yap_CloseHandles(q.CurSlot); + XREGS[i + 1] = ts[i].term(); + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + // allow Prolog style exceotion handling + LOCAL_RestartEnv = &q_env; + if (sigsetjmp(q_env, false)) + { throw YAPError(); } - return 0; + // don't forget, on success these bindings will still be there); + result = YAP_LeaveGoal(false, &q); + Yap_CloseHandles(q.CurSlot); + RECOVER_MACHINE_REGS(); + return result; } - // don't forget, on success these guys may create slots - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); - - if ((o = (Term)YAP_EnterGoal(ap, nullptr, &q))==0) - return 0; - Term terr; - if ((terr = Yap_GetException())) { + catch (YAPError e) + { YAP_LeaveGoal(false, &q); - Yap_CloseHandles(q.CurSlot); - throw YAPError(); + Yap_CloseHandles(q.CurSlot); + std::cerr << "Exception received by " << YAPApplTerm(ap.functor(), ts).text() << ".\n Forwarded...\n\n"; + throw e; } - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "out %ld", o); +} - t = Yap_GetFromSlot(q.CurSlot); - Yap_CloseHandles(q.CurSlot); - if (!t) { - YAP_LeaveGoal(false, &q); - t = 0; +bool YAPEngine::mgoal(Term t, Term tmod) +{ + try + { + CACHE_REGS + BACKUP_MACHINE_REGS(); + Term *ts = nullptr; + PredEntry *ap = Yap_get_pred(t, tmod, "C++"); + if (ap == nullptr) + return false; + arity_t arity = ap->ArityOfPE; + bool result; + sigjmp_buf q_env; + + + if (arity) { + if (IsApplTerm(t)) + { + ts = RepAppl(t) + 1; + } + else + { + ts = RepPair(t); + } + for (arity_t i = 0; i < arity; i++) + XREGS[i + 1] = ts[i]; + } else if ( IsAtomTerm(t)) { + ts = nullptr; + } + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + // allow Prolog style exceotion handling + LOCAL_RestartEnv = &q_env; + if (sigsetjmp(q_env, false)) + { + throw YAPError(); + } + // don't forget, on success these guys may create slots + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + + result = (bool)YAP_EnterGoal(ap, nullptr, &q); + // fprintf(stderr,"in");Yap_DebugPlWrite(t); + { + YAP_LeaveGoal(false, &q); + RECOVER_MACHINE_REGS(); + return result; + } } + catch (YAPError e) + { + YAP_LeaveGoal(false, &q); + Yap_CloseHandles(q.CurSlot); + throw e; + } +} + +void YAPEngine::release() +{ + + BACKUP_MACHINE_REGS(); + YAP_LeaveGoal(FALSE, &q); RECOVER_MACHINE_REGS(); - return t; +} + +Term YAPEngine::fun(Term t) +{ + CACHE_REGS + try + { + BACKUP_MACHINE_REGS(); + Term tmod = CurrentModule, *ts = nullptr; + PredEntry *ap; + arity_t arity; + Functor f; + sigjmp_buf q_env; + Atom name; + + BACKUP_MACHINE_REGS(); + if (IsApplTerm(t)) + { + ts = RepAppl(t) + 1; + f = (Functor)ts[-1]; + name = NameOfFunctor(f); + arity = ArityOfFunctor(f); + for (arity_t i = 0; i < arity; i++) + XREGS[i + 1] = ts[i]; + } + else if (IsAtomTerm(t)) + { + name = AtomOfTerm(t); + f = nullptr; + arity = 0; + } + else if (IsPairTerm(t)) + { + XREGS[1] = ts[0]; + XREGS[2] = ts[1]; + arity = 2; + name = AtomDot; + f = FunctorDot; + } + else + { + Yap_Error(TYPE_ERROR_CALLABLE, t, 0); + return 0L; + } + XREGS[arity + 1] = MkVarTerm(); + arity++; + f = Yap_MkFunctor(name, arity); + ap = (PredEntry *)(PredPropByFunc(f, tmod)); + q.CurSlot = Yap_StartSlots(); + q.p = P; + q.cp = CP; + // make sure this is safe + yhandle_t o = Yap_InitHandle(XREGS[arity]); + // allow Prolog style exceotion handling + LOCAL_RestartEnv = &q_env; + if (sigsetjmp(q_env, false)) + { + throw YAPError(); + } + // don't forget, on success these guys may create slots + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + + if (YAP_EnterGoal(ap, nullptr, &q) == 0) + return 0; + XREGS[arity] = Yap_GetFromSlot(o); + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "out %ld", o); + YAP_LeaveGoal(false, &q); + Yap_CloseHandles(q.CurSlot); + RECOVER_MACHINE_REGS(); + return XREGS[arity]; + } + catch (YAPError e) + { + YAP_LeaveGoal(false, &q); + Yap_CloseHandles(q.CurSlot); + std::cerr << "Exception received by " << __func__ << "( " << YAPTerm(t).text() << ").\n Forwarded..."; + throw e; + } } YAPQuery::YAPQuery(YAPFunctor f, YAPTerm mod, YAPTerm ts[]) - : YAPPredicate(f, mod) { + : YAPPredicate(f, mod) +{ /* ignore flags for now */ BACKUP_MACHINE_REGS(); - goal = YAPApplTerm(f, ts); - vnames = YAPListTerm(); + goal = YAPApplTerm(f, ts).gt(); + names = TermNil; openQuery(); RECOVER_MACHINE_REGS(); } +#if 0 YAPQuery::YAPQuery(YAPFunctor f, YAPTerm ts[]) : YAPPredicate(f) { - /* ignore flags for now */ + /* ignore flags for now */ BACKUP_MACHINE_REGS(); - goal = YAPApplTerm(f, ts); - vnames = YAPListTerm(); + goal = YAPApplTerm(f, ts).gt(); + names = TermNil; + openQuery(); + RECOVER_MACHINE_REGS(); +} +#endif + +YAPQuery::YAPQuery(YAPPredicate p, YAPTerm ts[]) : YAPPredicate(p.ap) +{ + BACKUP_MACHINE_REGS(); + goal = YAPApplTerm(YAPFunctor(p.ap->FunctorOfPred), ts).term(); + names = TermNil; openQuery(); RECOVER_MACHINE_REGS(); } -YAPQuery::YAPQuery(YAPPredicate p, YAPTerm ts[]) : YAPPredicate(p.ap) { - BACKUP_MACHINE_REGS(); - goal = YAPApplTerm(YAPFunctor(ap->FunctorOfPred), ts); - vnames = YAPListTerm(); - openQuery(); - RECOVER_MACHINE_REGS(); -} - -YAPListTerm YAPQuery::namedVars() { +Term YAPQuery::namedVars() +{ CACHE_REGS __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "vnames %s %ld", - vnames.text(), LOCAL_CurSlot); - return vnames; // should be o + names.text(), LOCAL_CurSlot); + return (names); // should be o } -YAPListTerm YAPQuery::namedVarsCopy() { +Term YAPQuery::namedVarsCopy() +{ CACHE_REGS - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "vnames %s %ld", - vnames.text(), LOCAL_CurSlot); - return YAPListTerm(YAP_CopyTerm(vnames.term())); // should be o + __android_log_print(NDROID_LOG_INFO, "YAPDroid", "vnames %s %ld", + names.text(), LOCAL_CurSlot); + return (YAP_CopyTerm(names)); // should be o } -bool YAPQuery::next() { +bool YAPQuery::next() +{ CACHE_REGS bool result; Term terr; - - BACKUP_MACHINE_REGS(); - if (!q_open) - return false; - if (setjmp(q_env)) { - if ((terr = Yap_GetException())) { - YAP_LeaveGoal(false, &q_h); - Yap_CloseHandles(q_handles); + LOCAL_RestartEnv = &q_env; + try + { + BACKUP_MACHINE_REGS(); + if (!q_open) + return false; + if (sigsetjmp(q_env, false)) + { throw YAPError(); } - return false; - } - // don't forget, on success these guys may create slots - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); + // don't forget, on success these guys may create slots + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "exec "); - if (q_state == 0) { - result = (bool)YAP_EnterGoal(ap, nullptr, &q_h); - } else { - LOCAL_AllowRestart = q_open; - result = (bool)YAP_RetryGoal(&q_h); + if (q_state == 0) + { + result = (bool)YAP_EnterGoal(ap, nullptr, &q_h); + } + else + { + LOCAL_AllowRestart = q_open; + result = (bool)YAP_RetryGoal(&q_h); + } + if (result) + { + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "vnames %d %s %ld", + q_state, vnames.text(), LOCAL_CurSlot); + } + else + { + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "fail"); + } + q_state = 1; + if ((terr = Yap_GetException())) + { + if ((terr = Yap_GetException())) + { + throw YAPError(); + } + } + __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "out %d", result); + + if (!result) + { + YAP_LeaveGoal(false, &q_h); + Yap_CloseHandles(q_handles); + q_open = false; + } + else + { + q_handles = Yap_StartSlots(); + } + RECOVER_MACHINE_REGS(); + return result; } - if (result) { - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "vnames %d %s %ld", - q_state, vnames.text(), LOCAL_CurSlot); - } else { - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "fail"); - } - q_state = 1; - if ((terr = Yap_GetException())) { - Yap_DebugPlWriteln(terr); + catch (YAPError e) + { + q_open = false; + Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm); + memset(LOCAL_ActiveError, 0, sizeof(*LOCAL_ActiveError)); YAP_LeaveGoal(false, &q_h); Yap_CloseHandles(q_handles); q_open = false; - throw YAPError(); + std::cerr << "Exception received by " << __func__ << "( " << YAPTerm(terr).text() << ").\n Forwarded...\n\n"; + throw e; } - __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "out %d", result); - - if (!result) { - YAP_LeaveGoal(false, &q_h); - Yap_CloseHandles(q_handles); - q_open = false; - } else { - q_handles = Yap_StartSlots(); - } - RECOVER_MACHINE_REGS(); - return result; } -void YAPQuery::cut() { +void YAPQuery::cut() +{ CACHE_REGS BACKUP_MACHINE_REGS(); @@ -742,7 +756,8 @@ void YAPQuery::cut() { RECOVER_MACHINE_REGS(); } -bool YAPQuery::deterministic() { +bool YAPQuery::deterministic() +{ CACHE_REGS BACKUP_MACHINE_REGS(); @@ -755,13 +770,15 @@ bool YAPQuery::deterministic() { YAPTerm YAPQuery::getTerm(yhandle_t t) { return YAPTerm(t); } -void YAPQuery::close() { +void YAPQuery::close() +{ CACHE_REGS RECOVER_MACHINE_REGS(); Yap_ResetException(worker_id); /* need to implement backtracking here */ - if (q_open != true || q_state == 0) { + if (q_open != true || q_state == 0) + { RECOVER_MACHINE_REGS(); return; } @@ -783,9 +800,11 @@ JNIEnv *Yap_jenv; extern JNIEXPORT jint JNICALL JNI_MySQLOnLoad(JavaVM *vm, void *reserved); -JNIEXPORT jint JNICALL JNI_MySQLOnLoad(JavaVM *vm, void *reserved) { +JNIEXPORT jint JNICALL JNI_MySQLOnLoad(JavaVM *vm, void *reserved) +{ JNIEnv *env; - if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) { + if (vm->GetEnv(reinterpret_cast(&env), JNI_VERSION_1_6) != JNI_OK) + { return -1; } Yap_jenv = env; @@ -799,21 +818,27 @@ static size_t Yap_AndroidMax, Yap_AndroidSz; extern void (*Yap_DisplayWithJava)(int c); -void Yap_displayWithJava(int c) { +void Yap_displayWithJava(int c) +{ char *ptr = Yap_AndroidBufp; if (!ptr) ptr = Yap_AndroidBufp = (char *)malloc(Yap_AndroidSz); ptr[Yap_AndroidSz++] = c; - if (Yap_AndroidMax - 1 == Yap_AndroidSz) { - if (Yap_AndroidMax < 32 * 1024) { + if (Yap_AndroidMax - 1 == Yap_AndroidSz) + { + if (Yap_AndroidMax < 32 * 1024) + { Yap_AndroidMax *= 2; - } else { + } + else + { Yap_AndroidMax += 32 * 1024; } Yap_AndroidBufp = (char *)realloc(ptr, Yap_AndroidMax); } Yap_AndroidBufp[Yap_AndroidSz] = '\0'; - if (c == '\n') { + if (c == '\n') + { Yap_AndroidBufp[Yap_AndroidSz] = '\0'; curren->run(Yap_AndroidBufp); Yap_AndroidSz = 0; @@ -822,8 +847,10 @@ void Yap_displayWithJava(int c) { #endif -void YAPEngine::doInit(YAP_file_type_t BootMode) { - if ((BootMode = YAP_Init(&init_args)) == YAP_FOUND_BOOT_ERROR) { +void YAPEngine::doInit(YAP_file_type_t BootMode) +{ + if ((BootMode = YAP_Init(&init_args)) == YAP_FOUND_BOOT_ERROR) + { throw YAPError(); } /* Begin preprocessor code */ @@ -837,9 +864,12 @@ void YAPEngine::doInit(YAP_file_type_t BootMode) { yerror = YAPError(); YAPQuery initq = YAPQuery(YAPAtom("$init_system")); - if (initq.next()) { + if (initq.next()) + { initq.cut(); - } else { + } + else + { // should throw exception } } @@ -847,10 +877,10 @@ void YAPEngine::doInit(YAP_file_type_t BootMode) { YAPEngine::YAPEngine(char *savedState, char *bootFile, size_t stackSize, size_t trailSize, size_t maxStackSize, size_t maxTrailSize, char *libDir, char *goal, char *topLevel, bool script, - bool fastBoot, - bool embedded, + bool fastBoot, bool embedded, YAPCallback *cb) - : _callback(0) { // a single engine can be active + : _callback(0) +{ // a single engine can be active YAP_file_type_t BootMode; int Argc = 1; @@ -887,7 +917,8 @@ YAPEngine::YAPEngine(char *savedState, char *bootFile, size_t stackSize, YAPEngine::YAPEngine(int argc, char *argv[], YAPCallback *cb) - : _callback(0) { // a single engine can be active + : _callback(0) +{ // a single engine can be active YAP_file_type_t BootMode; BootMode = YAP_parse_yap_arguments(argc, argv, &init_args); @@ -898,38 +929,48 @@ YAPEngine::YAPEngine(int argc, char *argv[], doInit(BootMode); } -YAPPredicate::YAPPredicate(YAPAtom at) { +YAPPredicate::YAPPredicate(YAPAtom at) +{ CACHE_REGS ap = RepPredProp(PredPropByAtom(at.a, Yap_CurrentModule())); } -YAPPredicate::YAPPredicate(YAPAtom at, arity_t arity) { +YAPPredicate::YAPPredicate(YAPAtom at, arity_t arity) +{ CACHE_REGS - if (arity) { + if (arity) + { Functor f = Yap_MkFunctor(at.a, arity); ap = RepPredProp(PredPropByFunc(f, Yap_CurrentModule())); - } else { + } + else + { ap = RepPredProp(PredPropByAtom(at.a, Yap_CurrentModule())); } } /// auxiliary routine to find a predicate in the current module. -PredEntry *YAPPredicate::getPred(Term &t, Term *&outp) { +PredEntry *YAPPredicate::getPred(Term &t, Term *&outp) +{ CACHE_REGS Term m = Yap_CurrentModule(); t = Yap_StripModule(t, &m); - if (IsVarTerm(t) || IsNumTerm(t)) { + if (IsVarTerm(t) || IsNumTerm(t)) + { if (IsVarTerm(t)) Yap_Error(INSTANTIATION_ERROR, t, 0); else if (IsNumTerm(t)) Yap_Error(TYPE_ERROR_CALLABLE, t, 0); throw YAPError(); } - if (IsAtomTerm(t)) { + if (IsAtomTerm(t)) + { ap = RepPredProp(PredPropByAtom(AtomOfTerm(t), m)); outp = (Term *)NULL; return ap; - } else if (IsPairTerm(t)) { + } + else if (IsPairTerm(t)) + { Term ts[2]; ts[0] = t; ts[1] = m; @@ -937,18 +978,23 @@ PredEntry *YAPPredicate::getPred(Term &t, Term *&outp) { outp = RepAppl(t) + 1; } Functor f = FunctorOfTerm(t); - if (IsExtensionFunctor(f)) { + if (IsExtensionFunctor(f)) + { Yap_Error(TYPE_ERROR_CALLABLE, t, 0); ; throw YAPError(); - } else { + } + else + { ap = RepPredProp(PredPropByFunc(f, m)); outp = RepAppl(t) + 1; } return ap; } -void *YAPPrologPredicate::assertClause(YAPTerm cl, bool last, YAPTerm source) { +X_API bool YAPPrologPredicate::assertClause(YAPTerm cl, bool last, + YAPTerm source) +{ CACHE_REGS RECOVER_MACHINE_REGS(); @@ -962,57 +1008,65 @@ void *YAPPrologPredicate::assertClause(YAPTerm cl, bool last, YAPTerm source) { yamop *codeaddr = Yap_cclause(tt, ap->ArityOfPE, Yap_CurrentModule(), sourcet); /* vsc: give the number of arguments to cclause in case there is overflow */ - if (LOCAL_ErrorMessage) { + if (LOCAL_ErrorMessage) + { RECOVER_MACHINE_REGS(); - return 0; + return false; } Term *tref = &ntt; if (Yap_addclause(ntt, codeaddr, (last ? TermAssertz : TermAsserta), - Yap_CurrentModule(), tref)) { + Yap_CurrentModule(), tref)) + { RECOVER_MACHINE_REGS(); } return tref; } -void *YAPPrologPredicate::assertFact(YAPTerm *cl, bool last) { +bool YAPPrologPredicate::assertFact(YAPTerm *cl, bool last) +{ CACHE_REGS - arity_t i; + arity_t i; RECOVER_MACHINE_REGS(); Term tt = AbsAppl(HR); *HR++ = (CELL)(ap->FunctorOfPred); - for (i = 0; i < ap->ArityOfPE; i++,cl++) - *HR++ = cl->gt(); + for (i = 0; i < ap->ArityOfPE; i++, cl++) + *HR++ = cl->gt(); yamop *codeaddr = Yap_cclause(tt, ap->ArityOfPE, Yap_CurrentModule(), tt); /* vsc: give the number of arguments to cclause in case there is overflow */ - if (LOCAL_ErrorMessage) { + if (LOCAL_ErrorMessage) + { RECOVER_MACHINE_REGS(); - return 0; + return false; } Term *tref = &tt; if (Yap_addclause(tt, codeaddr, (last ? TermAssertz : TermAsserta), - Yap_CurrentModule(), tref)) { + Yap_CurrentModule(), tref)) + { RECOVER_MACHINE_REGS(); } return tref; } -void *YAPPrologPredicate::retractClause(YAPTerm skeleton, bool all) { +void *YAPPrologPredicate::retractClause(YAPTerm skeleton, bool all) +{ return 0; } -const char *YAPError::text() { - +std::string YAPError::text() +{ char buf[256]; std::string s = ""; - if (LOCAL_ActiveError->errorFunction) { + if (LOCAL_ActiveError->errorFunction) + { s += LOCAL_ActiveError->errorFile; s += ":"; sprintf(buf, "%ld", (long int)LOCAL_ActiveError->errorLine); s += buf; s += ":0 in C-code"; } - if (LOCAL_ActiveError->prologPredLine) { + if (LOCAL_ActiveError->prologPredLine) + { s += "\n"; s += LOCAL_ActiveError->prologPredFile->StrOfAE; s += ":"; @@ -1034,9 +1088,11 @@ const char *YAPError::text() { s += "."; s += LOCAL_ActiveError->errorAsText->StrOfAE; s += ".\n"; - if (LOCAL_ActiveError->errorTerm) { - Term t = Yap_PopTermFromDB(LOCAL_ActiveError->errorTerm); - if (t) { + if (LOCAL_ActiveError->errorTerm) + { + Term t = LOCAL_ActiveError->errorTerm->Entry; + if (t) + { s += "error term is: "; s += YAPTerm(t).text(); s += "\n"; @@ -1047,22 +1103,28 @@ const char *YAPError::text() { } void YAPEngine::reSet() - { +{ /* ignore flags for now */ BACKUP_MACHINE_REGS(); Yap_RebootHandles(worker_id); - while (B->cp_b) B= B->cp_b; - P = FAILCODE; - Yap_exec_absmi(true, YAP_EXEC_ABSMI); - /* recover stack space */ - HR = B->cp_h; - TR = B->cp_tr; + while (B->cp_b) + B = B->cp_b; + P = FAILCODE; + Yap_exec_absmi(true, YAP_EXEC_ABSMI); + /* recover stack space */ + HR = B->cp_h; + TR = B->cp_tr; #ifdef DEPTH_LIMIT - DEPTH = B->cp_depth; + DEPTH = B->cp_depth; #endif /* DEPTH_LIMIT */ - YENV = ENV = B->cp_env; + YENV = ENV = B->cp_env; RECOVER_MACHINE_REGS(); - } - +} +YAPError::YAPError(yap_error_number id, YAPTerm culprit, std::string txt) +{ + ID = id; + goal = culprit.text(); + info = txt; +} diff --git a/CXX/yapi.hh b/CXX/yapi.hh index b7549a370..5c5289d2f 100644 --- a/CXX/yapi.hh +++ b/CXX/yapi.hh @@ -5,8 +5,10 @@ #include #include +#include +#include -//! @{ + //! @{ /** * * @defgroup yap-cplus-interface An object oriented interface for YAP. @@ -67,38 +69,6 @@ extern "C" { // taken from yap_structs.h #include "iopreds.h" -#ifdef SWIGPYTHON -extern PyObject *yap_to_pythond(YAP_Term t, bool eval); -extern PyObject *term_to_python(yhandle_t t, bool eval); -extern PyObject *deref_term_to_python(yhandle_t t); -X_API bool init_python(void); -extern Term pythonToYAP(PyObject *p); - -extern PyObject *py_Main; - -extern inline PyObject *AtomToPy(const char *s) { - if (strcmp(s, "true") == 0) - return Py_True; - if (strcmp(s, "false") == 0) - return Py_False; - if (strcmp(s, "none") == 0) - return Py_None; - if (strcmp(s, "[]") == 0) - return PyList_New(0); - else if (strcmp(s, "{}") == 0) - return PyDict_New(); - /* return __main__,s */ - else if (PyObject_HasAttrString(py_Main, s)) { - return PyObject_GetAttrString(py_Main, s); - } - // no way to translate - return NULL; -} - -X_API extern PyObject *yap_to_python(YAP_Term t, bool eval); - -#endif - X_API void YAP_UserCPredicate(const char *, YAP_UserCPred, YAP_Arity arity); /* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity) diff --git a/CXX/yapie.hh b/CXX/yapie.hh index 1c425cc8e..9c155a9e3 100644 --- a/CXX/yapie.hh +++ b/CXX/yapie.hh @@ -7,12 +7,17 @@ class YAPTerm; /// take information on a Prolog error: class YAPError { - std::string name, errorClass, info; + yap_error_number ID; + std::string goal, info; int swigcode; - + public: - /// error handling when receiving the error term - YAPError(){}; + YAPError(){ + //ID = LOCAL_ActiveError->errorNo; + } + /// error handler object with initial data when receiving the error term + YAPError(yap_error_number id, YAPTerm culprit, std::string txt); + /// we just know the error number /// exact error ID yap_error_number getID() { return LOCAL_ActiveError->errorNo; }; @@ -27,7 +32,7 @@ public: /// the term that caused the bug // YAPTerm getCulprit(LOCAL_ActiveError->errorFile){}; /// text describing the Error - const char *text(); + std::string text(); }; #endif diff --git a/CXX/yapq.hh b/CXX/yapq.hh index 31c007bfd..ca7d350ef 100644 --- a/CXX/yapq.hh +++ b/CXX/yapq.hh @@ -13,19 +13,19 @@ class YAPPredicate; * interface to a YAP Query; * uses an SWI-like status info internally. */ -class YAPQuery : public YAPPredicate { +class YAPQuery : public YAPPredicate +{ bool q_open; int q_state; yhandle_t q_g, q_handles; struct yami *q_p, *q_cp; - jmp_buf q_env; + sigjmp_buf q_env; int q_flags; YAP_dogoalinfo q_h; YAPQuery *oq; - YAPListTerm vnames; - YAPTerm goal; + Term names; + Term goal; // temporaries - Term tgoal, names; void openQuery(); @@ -46,20 +46,19 @@ public: /// /// It is given a functor, and an array of terms that must have at least /// the same arity as the functor. Works within the current module. - YAPQuery(YAPFunctor f, YAPTerm t[]); + //YAPQuery(YAPFunctor f, YAPTerm t[]); /// string constructor without varnames /// /// It is given a string, calls the parser and obtains a Prolog term that /// should be a callable /// goal. - inline YAPQuery(const char *s) : YAPPredicate(s, tgoal, names) { + inline YAPQuery(const char *s) : YAPPredicate(s, goal, names) + { BACKUP_H(); __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "got game %ld", LOCAL_CurSlot); if (!ap) return; - goal = YAPTerm(tgoal); - vnames = YAPListTerm(names); __android_log_print(ANDROID_LOG_INFO, "YAPDroid", "%s", vnames.text()); openQuery(); RECOVER_H(); @@ -68,9 +67,10 @@ public: /// /// It is given an atom, and a Prolog term that should be a callable /// goal, say `main`, `init`, `live`. - inline YAPQuery(YAPAtom g) : YAPPredicate(g) { - goal = YAPAtomTerm(g); - vnames = YAPListTerm(); + inline YAPQuery(YAPAtom g) : YAPPredicate(g) + { + goal = YAPAtomTerm(g).gt(); + names = TermNil; openQuery(); }; @@ -92,19 +92,20 @@ public: const char *text(); /// remove alternatives in the current search space, and finish the current /// query - void cut(); /// finish the current query: undo all bindings. void close(); /// query variables. - YAPListTerm namedVars(); + void cut(); + Term namedVars(); /// query variables, but copied out - YAPListTerm namedVarsCopy(); + Term namedVarsCopy(); /// convert a ref to a binding. YAPTerm getTerm(yhandle_t t); /// simple YAP Query; /// just calls YAP and reports success or failure, Useful when we just /// want things done, eg YAPCommand("load_files(library(lists), )") - inline bool command() { + inline bool command() + { bool rc = next(); close(); return rc; @@ -116,7 +117,8 @@ public: /// This class implements a callback Prolog-side. It will be inherited by the /// Java or Python /// class that actually implements the callback. -class YAPCallback { +class YAPCallback +{ public: virtual ~YAPCallback() {} virtual void run() { LOG("callback"); } @@ -129,7 +131,8 @@ public: * * */ -class YAPEngine { +class YAPEngine +{ private: YAPCallback *_callback; YAP_init_args init_args; @@ -156,14 +159,16 @@ public: /// remove current callback void delYAPCallback() { _callback = 0; } /// set a new callback - void setYAPCallback(YAPCallback *cb) { + void setYAPCallback(YAPCallback *cb) + { delYAPCallback(); _callback = cb; } /// execute the callback. ////void run() { if (_callback) _callback->run(); } /// execute the callback with a text argument. - void run(char *s) { + void run(char *s) + { if (_callback) _callback->run(s); } @@ -181,22 +186,30 @@ public: /// current directory for the engine bool call(YAPPredicate ap, YAPTerm ts[]); /// current directory for the engine - bool goalt(YAPTerm t); + bool goalt(YAPTerm Yt) { return Yt.term(); }; /// current directory for the engine - bool goal(Term t); + bool mgoal(Term t, Term tmod); + /// current directory for the engine + + bool goal(Term t) + { + return mgoal(t, CurrentModule); + } /// reset Prolog state void reSet(); /// release: assune that there are no stack pointers, just release memory // for last execution void release(); - const char *currentDir() { + const char *currentDir() + { char dir[1024]; std::string s = Yap_getcwd(dir, 1024 - 1); return s.c_str(); }; /// report YAP version as a string - const char *version() { + const char *version() + { std::string s = Yap_version(); return s.c_str(); }; diff --git a/CXX/yapt.hh b/CXX/yapt.hh index 8a2b52931..90ae8e510 100644 --- a/CXX/yapt.hh +++ b/CXX/yapt.hh @@ -2,9 +2,12 @@ #ifndef YAPT_HH #define YAPT_HH 1 -extern "C" Term YAP_ReadBuffer(const char *s, Term *tp); +extern "C" { + Term YAP_ReadBuffer(const char *s, Term *tp); +} class YAPError; + /** * @brief Generic Prolog Term */ @@ -18,20 +21,32 @@ class YAPTerm { friend class YAPListTerm; protected: - yhandle_t t; /// handle to term, equivalent to term_t - void mk(Term t0); /// internal method to convert from term to handle - Term gt(); /// get handle and obtain term + yhandle_t t; /// handle to term, equivalent to term_t + public: - virtual ~YAPTerm(){ LOCAL_HandleBase[t] = TermFreeTerm; - while ( LOCAL_HandleBase[LOCAL_CurSlot-1] == TermFreeTerm) - LOCAL_CurSlot--; - } - YAPTerm(Term tn) { - mk(tn); - } /// private method to convert from Term (internal YAP representation) to + Term gt() { + CACHE_REGS + // fprintf(stderr,"?%d,%lx,%p\n",t,LOCAL_HandleBase[t], HR); + // Yap_DebugPlWriteln(LOCAL_HandleBase[t]); + return Yap_GetFromSlot(t); + }; + + void mk(Term t0) { + CACHE_REGS t = Yap_InitSlot(t0); + // fprintf(stderr,"+%d,%lx,%p,%p",t,t0,HR,ASP); Yap_DebugPlWriteln(t0); + }; + + YAPTerm(Term tn) { mk(tn); }; +#ifdef SWIGPYTHON + // YAPTerm(struct _object *inp) { + // Term tinp = pythonToYAP(inp); + // t = Yap_InitSlot(tinp); + //} +#endif + /// private method to convert from Term (internal YAP representation) to /// YAPTerm // do nothing constructor - YAPTerm() { mk(MkVarTerm()); } + YAPTerm() { mk(MkVarTerm()); }; // YAPTerm(yhandle_t i) { t = i; }; /// pointer to term YAPTerm(void *ptr); @@ -40,6 +55,21 @@ public: Term tp; mk(YAP_ReadBuffer(s, &tp)); } + +#if 1 + /// Term destructor, tries to recover slot + virtual ~YAPTerm() { + // fprintf(stderr,"-%d,%lx,%p ",t,LOCAL_HandleBase[t] ,HR); + if (!t) + return; + Yap_DebugPlWriteln(LOCAL_HandleBase[t]); + LOCAL_HandleBase[t] = TermFreeTerm; + while (LOCAL_HandleBase[LOCAL_CurSlot - 1] == TermFreeTerm) { + LOCAL_CurSlot--; + } + }; +#endif + /// construct a term out of an integer (if you know object type use /// YAPIntegerTerm) /// YAPTerm(long int num) { mk(MkIntegerTerm(num)); } @@ -51,23 +81,64 @@ public: /// extract the tag of a term, after dereferencing. YAP_tag_t tag(); /// copy the term ( term copy ) - YAPTerm deepCopy(); + Term deepCopy(); /// numbervars ( int start, bool process=false ) intptr_t numberVars(intptr_t start, bool skip_singletons = false); inline Term term() { return gt(); } /// from YAPTerm to Term (internal YAP representation) + inline void bind(Term b) { LOCAL_HandleBase[t] = b; } + inline void bind(YAPTerm *b) { LOCAL_HandleBase[t] = b->term(); } + /// from YAPTerm to Term (internal YAP representation) /// fetch a sub-term - YAPTerm &operator[](size_t n); + Term &operator[](arity_t n); // const YAPTerm *vars(); /// this term is == to t1 - virtual bool exactlyEqual(YAPTerm t1); - virtual bool unify(YAPTerm t1); /// t = t1 - virtual bool unifiable(YAPTerm t1); /// we can unify t and t1 - virtual bool variant( - YAPTerm t1); /// t =@= t1, the two terms are equal up to variable renaming - virtual intptr_t hashTerm(size_t sz, size_t depth, - bool variant); /// term hash, + virtual bool exactlyEqual(YAPTerm t1) { + bool out; + BACKUP_MACHINE_REGS(); + out = Yap_eq(gt(), t1.term()); + RECOVER_MACHINE_REGS(); + return out; + }; + + /// t = t1 + virtual bool unify(YAPTerm t1) { + intptr_t out; + BACKUP_MACHINE_REGS(); + out = Yap_unify(gt(), t1.term()); + RECOVER_MACHINE_REGS(); + return out; + }; + + /// we can unify t and t1 + virtual bool unifiable(YAPTerm t1) { + bool out; + BACKUP_MACHINE_REGS(); + out = Yap_eq(gt(), t1.term()); + RECOVER_MACHINE_REGS(); + return out; + }; + + /// t =@= t1, the two terms are equal up to variable renamingvirtual bool + /// variant( + inline virtual YAP_Term variant(YAPTerm t1) { + intptr_t out; + BACKUP_MACHINE_REGS(); + out = Yap_Variant(gt(), t1.term()); + RECOVER_MACHINE_REGS(); + return out; + }; + + virtual intptr_t hashTerm(size_t sz, size_t depth, bool variant) { + intptr_t out; + + BACKUP_MACHINE_REGS(); + out = Yap_TermHash(gt(), sz, depth, variant); + RECOVER_MACHINE_REGS(); + return out; + }; + /// term hash, virtual bool isVar() { return IsVarTerm(gt()); } /// type check for unound virtual bool isAtom() { return IsAtomTerm(gt()); } /// type check for atom virtual bool isInteger() { @@ -88,19 +159,19 @@ public: virtual bool isList() { return Yap_IsListTerm(gt()); } /// term is a list /// extract the argument i of the term, where i in 1...arity - virtual YAPTerm getArg(arity_t i) { + virtual Term getArg(arity_t i) { BACKUP_MACHINE_REGS(); + Term tf = 0; Term t0 = gt(); - YAPTerm tf; if (IsApplTerm(t0)) - tf = YAPTerm(ArgOfTerm(i, t0)); + tf = (ArgOfTerm(i, t0)); else if (IsPairTerm(t0)) { if (i == 1) - tf = YAPTerm(HeadOfTerm(t0)); + tf = (HeadOfTerm(t0)); else if (i == 2) - tf = YAPTerm(TailOfTerm(t0)); + tf = (TailOfTerm(t0)); } else { - tf = YAPTerm((Term)0); + tf = ((Term)0); } RECOVER_MACHINE_REGS(); return tf; @@ -123,7 +194,24 @@ public: } /// return a string with a textual representation of the term - virtual const char *text(); + virtual const char *text() { + CACHE_REGS + size_t length = 0; + encoding_t enc = LOCAL_encoding; + char *os; + + BACKUP_MACHINE_REGS(); + if (!(os = Yap_TermToString(Yap_GetFromSlot(t), &length, enc, + Handle_vars_f))) { + RECOVER_MACHINE_REGS(); + return 0; + } + RECOVER_MACHINE_REGS(); + length = strlen(os) + 1; + char *sm = (char *)malloc(length + 1); + strcpy(sm, os); + return sm; + }; /// return a handle to the term inline yhandle_t handle() { return t; }; @@ -169,16 +257,21 @@ class YAPApplTerm : public YAPTerm { YAPApplTerm(Term t0) { mk(t0); } public: - ~YAPApplTerm() {} + YAPApplTerm(Functor f, Term ts[]) { + BACKUP_MACHINE_REGS(); + Term t0 = Yap_MkApplTerm(f, f->ArityOfFE, ts); + mk(t0); + RECOVER_MACHINE_REGS(); + }; YAPApplTerm(YAPFunctor f, YAPTerm ts[]); - YAPApplTerm(const char *s, std::vector ts); + YAPApplTerm(const std::string s, std::vector ts); YAPApplTerm(YAPFunctor f); YAPFunctor getFunctor(); - YAPTerm getArg(arity_t i) { + Term getArg(arity_t i) { BACKUP_MACHINE_REGS(); Term t0 = gt(); - YAPTerm tf; - tf = YAPTerm(ArgOfTerm(i, t0)); + Term tf; + tf = ArgOfTerm(i, t0); RECOVER_MACHINE_REGS(); return tf; }; @@ -209,8 +302,8 @@ class YAPPairTerm : public YAPTerm { public: YAPPairTerm(YAPTerm hd, YAPTerm tl); YAPPairTerm(); - YAPTerm getHead() { return YAPTerm(HeadOfTerm(gt())); } - YAPTerm getTail() { return YAPTerm(TailOfTerm(gt())); } + Term getHead() { return (HeadOfTerm(gt())); } + Term getTail() { return (TailOfTerm(gt())); } }; /** @@ -234,8 +327,8 @@ public: }; /** - * @brief Floating Point Term - */ + * @brief Floating Point Term + */ class YAPFloatTerm : public YAPNumberTerm { public: @@ -267,28 +360,27 @@ public: return Yap_SkipList(&t1, &tailp); } /// Extract the nth element. - YAPTerm &operator[](size_t n); + Term &operator[](size_t n); /// Extract the first element of a list. /// /// @param[in] the list - YAPTerm car(); + Term car(); /// Extract the tail elements of a list. /// /// @param[in] the list - YAPListTerm cdr() { + Term cdr() { Term to = gt(); if (IsPairTerm(to)) - return YAPListTerm(TailOfTerm(to)); + return (TailOfTerm(to)); else if (to == TermNil) - return YAPListTerm(); + return TermNil; /* error */ - Yap_Error(TYPE_ERROR_LIST, t, 0); - throw YAPError(); + throw YAPError(TYPE_ERROR_LIST, YAPTerm(to), ""); } /// copy a list. /// /// @param[in] the list - YAPListTerm dup(); + Term dup(); /// Check if the list is empty. /// @@ -337,15 +429,15 @@ public: YAPAtomTerm(wchar_t *s); // Constructor: receives a sequence of n wchar_ts, whatever they may be; YAPAtomTerm(wchar_t *s, size_t len); - virtual bool isVar() { return false; } /// type check for unbound - virtual bool isAtom() { return true; } /// type check for atom - virtual bool isInteger() { return false; } /// type check for integer - virtual bool isFloat() { return false; } /// type check for floating-point - virtual bool isString() { return false; } /// type check for a string " ... " - virtual bool isCompound() { return false; } /// is a primitive term - virtual bool isAppl() { return false; } /// is a structured term - virtual bool isPair() { return false; } /// is a pair term - virtual bool isGround() { return true; } /// term is ground + bool isVar() { return false; } /// type check for unbound + bool isAtom() { return true; } /// type check for atom + bool isInteger() { return false; } /// type check for integer + bool isFloat() { return false; } /// type check for floating-point + bool isString() { return false; } /// type check for a string " ... " + bool isCompound() { return false; } /// is a primitive term + bool isAppl() { return false; } /// is a structured term + bool isPair() { return false; } /// is a pair term + virtual bool isGround() { return true; } /// term is ground virtual bool isList() { return gt() == TermNil; } /// [] is a list // Getter: outputs the atom; YAPAtom getAtom() { return YAPAtom(AtomOfTerm(gt())); } diff --git a/H/ATOMS b/H/ATOMS index 07ac71035..c43c033f1 100644 --- a/H/ATOMS +++ b/H/ATOMS @@ -95,7 +95,7 @@ A Csult F "$csult" A CurrentModule F "$current_module" A Cut N "!" A CutBy F "$cut_by" -A DAbort F "$abort" +A DAbort N "abort" A DBLoad F "$db_load" A DBREF N "DBRef" A DBReference N "db_reference" @@ -294,6 +294,7 @@ A PastEndOfStream N "past_end_of_stream" A PermissionError N "permission_error" A Pi N "pi" A Pipe N "pipe" +A Priority N "priority" A Plus N "+" A Pointer N "pointer" A Portray F "portray" @@ -546,11 +547,13 @@ F NBQueue Queue 4 F Not Not 1 F Obj Obj 1 F Or Semic 2 +F Output Output 1 F PermissionError PermissionError 3 F Plus Plus 2 F Portray Portray 1 F PrintMessage PrintMessage 2 F Procedure Procedure 5 +F Priority Priority 1 F PrologConstraint Prolog 2 F ProtectStack ProtectStack 4 F Query Query 1 diff --git a/H/LOCALS b/H/LOCALS index 26ad866d9..31dac822d 100755 --- a/H/LOCALS +++ b/H/LOCALS @@ -145,7 +145,7 @@ ADDR db_vec0 =NULL struct RB_red_blk_node* db_root =NULL struct RB_red_blk_node* db_nil =NULL -sigjmp_buf gc_restore void +sigjmp_buf* gc_restore void CELL* extra_gc_cells void CELL* extra_gc_cells_base void CELL* extra_gc_cells_top void @@ -160,8 +160,8 @@ struct mem_blk* CMemFirstBlock =NULL UInt CMemFirstBlockSz =0L // Variable used by the compiler to store number of permanent vars in a clause -int nperm =0L - +int nperm =0 +int jMP =0 // Thread Local Area for Labels Int* LabelFirstArray =NULL UInt LabelFirstArraySz =0L @@ -198,7 +198,7 @@ ADDR TrailTop void yap_error_descriptor_t* ActiveError =calloc(sizeof(yap_error_descriptor_t),1) /// pointer to an exception term, from throw -jmp_buf IOBotch void +jmp_buf* IOBotch void TokEntry* tokptr void TokEntry* toktide void VarEntry* VarTable void @@ -209,7 +209,7 @@ CELL* CommentsNextChar void wchar_t* CommentsBuff void size_t CommentsBuffPos void size_t CommentsBuffLim void -sigjmp_buf RestartEnv void +sigjmp_buf* RestartEnv void char FileNameBuf[YAP_FILENAME_MAX+1] void char FileNameBuf2[YAP_FILENAME_MAX+1] void diff --git a/H/TermExt.h b/H/TermExt.h index e2169ddb1..e8658cc2c 100755 --- a/H/TermExt.h +++ b/H/TermExt.h @@ -302,6 +302,8 @@ INLINE_ONLY inline EXTERN Term __MkStringTerm(const char *s USES_REGS) { return t; } +#define MkUStringTerm(i) __MkUStringTerm((i)PASS_REGS) + INLINE_ONLY inline EXTERN Term __MkUStringTerm(const unsigned char *s USES_REGS); diff --git a/H/Yap.h b/H/Yap.h index 07bd31a3d..40ebc7927 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -129,37 +129,6 @@ #endif #endif /* defined(HAVE_NULLPTR) */ -/* Microsoft's Visual C++ Compiler */ -#ifdef _MSC_VER /* adjust a config.h from mingw32 to work with vc++ */ -#ifdef HAVE_GCC -#undef HAVE_GCC -#endif /* HAVE_GCC */ -#ifdef USE_THREADED_CODE -#undef USE_THREADED_CODE -#endif /* USE_THREADED_CODE */ -#define inline __inline -#define YAP_VERSION "YAP-6.3.4" -#define BIN_DIR "c:\\Yap\\bin" -#define LIB_DIR "c:\\Yap\\lib\\Yap" -#define SHARE_DIR "c:\\Yap\\share\\Yap" -#ifdef HOST_ALIAS -#undef HOST_ALIAS -#endif /* HOST_ALIAS */ -#define HOST_ALIAS "i386-pc-win32" -#ifdef HAVE_IEEEFP_H -#undef HAVE_IEEEFP_H -#endif /* HAVE_IEEEFP_H */ -#ifdef HAVE_UNISTD_H -#undef HAVE_UNISTD_H -#endif /* HAVE_UNISTD_H */ -#ifdef HAVE_SYS_TIME_H -#undef HAVE_SYS_TIME_H -#endif /* HAVE_SYS_TIME_H */ -#endif /* _MSC_VER */ - -#if HAVE_TIME_H -#include -#endif #ifdef __MINGW32__ #ifndef _WIN32 @@ -727,10 +696,10 @@ typedef struct thandle { struct timeval *start_of_times_sysp; struct timeval *last_time_sysp; #elif _WIN32 - struct _FILETIME *start_of_timesp; - struct _FILETIME *last_timep; - struct _FILETIME *start_of_times_sysp; - struct _FILETIME *last_time_sysp; + win64_time_t *start_of_timesp; + win64_time_t *last_timep; + win64_time_t *start_of_times_sysp; + win64_time_t *last_time_sysp; #endif } yap_thandle; #endif /* THREADS */ diff --git a/H/compile.h b/H/YapCompile.h similarity index 99% rename from H/compile.h rename to H/YapCompile.h index e08067bf2..520ef48f7 100644 --- a/H/compile.h +++ b/H/YapCompile.h @@ -8,7 +8,7 @@ * * ************************************************************************** * * -* File: compile.h * +* File: YapCompile.h * * Last rev: * * mods: * * comments: compiler data structures and routines * diff --git a/H/eval.h b/H/YapEval.h similarity index 99% rename from H/eval.h rename to H/YapEval.h index f61be284b..0299ec7f5 100644 --- a/H/eval.h +++ b/H/YapEval.h @@ -1,6 +1,6 @@ /************************************************************************* * * -* YAP Prolog @(#)eval.h 1.2 +* YAP Prolog @(#)YapEval.h 1.2 * * * Yap Prolog was developed at NCCUP - Universidade do Porto * * * @@ -8,7 +8,7 @@ * * ************************************************************************** * * -* File: eval.h * +* File: YapEval.h * * Last rev: * * mods: * * comments: arithmetical functions info * @@ -17,7 +17,7 @@ /** -@file eval.h +@file YapEval.h @defgroup arithmetic Arithmetic in YAP @@ -407,7 +407,7 @@ yamop *Yap_EvalError__(const char *, const char *, int, yap_error_number, Term, ...); #define Yap_ArithError(id, t, ...) \ - Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, 2, __VA_ARGS__) + Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, t, __VA_ARGS__) #define Yap_BinError(id) \ Yap_Error__(__FILE__, __FUNCTION__, __LINE__, id, 0L, "") #define Yap_AbsmiError(id) \ diff --git a/H/YapFlags.h b/H/YapFlags.h index f13ef7dcc..81869b5b6 100644 --- a/H/YapFlags.h +++ b/H/YapFlags.h @@ -204,7 +204,7 @@ typedef struct x_el { } xarg; typedef struct struct_param { - char *name; + const char *name; flag_func type; int id; } param_t; diff --git a/H/YapHeap.h b/H/YapHeap.h index c86532ac5..233c5ebc8 100755 --- a/H/YapHeap.h +++ b/H/YapHeap.h @@ -154,7 +154,7 @@ typedef struct thandle { /******************* this is the data base: everything here should be possible to restore ********************/ -#if __INIT_C__ +#if __INIT_C__ || defined(MSC_VER) #define EXTERNAL #else #define EXTERNAL extern diff --git a/H/YapTags.h b/H/YapTags.h index 4ae7f2e06..2eb5e7b2d 100644 --- a/H/YapTags.h +++ b/H/YapTags.h @@ -166,13 +166,15 @@ INLINE_ONLY inline EXTERN Term *VarOfTerm(Term t) { return (Term *)(t); } INLINE_ONLY inline EXTERN Term MkVarTerm__(USES_REGS1); -INLINE_ONLY inline EXTERN Term MkVarTerm__(USES_REGS1) { +INLINE_ONLY +inline EXTERN Term MkVarTerm__(USES_REGS1) { return (Term)((*HR = 0, HR++)); } INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *); -INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *t) { return (int)(*(t) == +INLINE_ONLY +inline EXTERN bool IsUnboundVar(Term *t) { return (int)(*(t) == 0); } #else @@ -181,13 +183,15 @@ INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *t) { return (int)(*(t) == INLINE_ONLY inline EXTERN Term MkVarTerm__(USES_REGS1); -INLINE_ONLY inline EXTERN Term MkVarTerm__(USES_REGS1) { +INLINE_ONLY +inline EXTERN Term MkVarTerm__(USES_REGS1) { return (Term)((*HR = (CELL)HR, HR++)); } INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *); -INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *t) { +INLINE_ONLY + inline EXTERN bool IsUnboundVar(Term *t) { return *(t) == (Term)(t); } @@ -195,13 +199,15 @@ INLINE_ONLY inline EXTERN bool IsUnboundVar(Term *t) { INLINE_ONLY inline EXTERN CELL *PtrOfTerm(Term); -INLINE_ONLY inline EXTERN CELL *PtrOfTerm(Term t) { +INLINE_ONLY + inline EXTERN CELL *PtrOfTerm(Term t) { return (CELL *)(*(CELL *)(t)); } INLINE_ONLY inline EXTERN Functor FunctorOfTerm(Term); -INLINE_ONLY inline EXTERN Functor FunctorOfTerm(Term t) { +INLINE_ONLY + inline EXTERN Functor FunctorOfTerm(Term t) { return (Functor)(*RepAppl(t)); } @@ -209,13 +215,15 @@ INLINE_ONLY inline EXTERN Functor FunctorOfTerm(Term t) { INLINE_ONLY inline EXTERN Term MkAtomTerm(Atom); -INLINE_ONLY inline EXTERN Term MkAtomTerm(Atom a) { +INLINE_ONLY + inline EXTERN Term MkAtomTerm(Atom a) { return (Term)(AtomTag | (CELL)(a)); } INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t); -INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t) { +INLINE_ONLY + inline EXTERN Atom AtomOfTerm(Term t) { return (Atom)((~AtomTag & (CELL)(t))); } @@ -223,13 +231,15 @@ INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t) { INLINE_ONLY inline EXTERN Term MkAtomTerm(Atom); -INLINE_ONLY inline EXTERN Term MkAtomTerm(Atom at) { +INLINE_ONLY + inline EXTERN Term MkAtomTerm(Atom at) { return (Term)(TAGGEDA((CELL)AtomTag, (CELL)(at))); } INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t); -INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t) { +INLINE_ONLY + inline EXTERN Atom AtomOfTerm(Term t) { return (Atom)(NonTagPart(t)); } @@ -237,13 +247,15 @@ INLINE_ONLY inline EXTERN Atom AtomOfTerm(Term t) { INLINE_ONLY inline EXTERN bool IsAtomTerm(Term); -INLINE_ONLY inline EXTERN bool IsAtomTerm(Term t) { +INLINE_ONLY + inline EXTERN bool IsAtomTerm(Term t) { return CHKTAG((t), AtomTag); } INLINE_ONLY inline EXTERN Term MkIntTerm(Int); -INLINE_ONLY inline EXTERN Term MkIntTerm(Int n) { +INLINE_ONLY + inline EXTERN Term MkIntTerm(Int n) { return (Term)(TAGGED(NumberTag, (n))); } @@ -254,19 +266,22 @@ INLINE_ONLY inline EXTERN Term MkIntTerm(Int n) { INLINE_ONLY inline EXTERN Term MkIntConstant(Int); -INLINE_ONLY inline EXTERN Term MkIntConstant(Int n) { +INLINE_ONLY + inline EXTERN Term MkIntConstant(Int n) { return (Term)(NONTAGGED(NumberTag, (n))); } INLINE_ONLY inline EXTERN bool IsIntTerm(Term); -INLINE_ONLY inline EXTERN bool IsIntTerm(Term t) { +INLINE_ONLY + inline EXTERN bool IsIntTerm(Term t) { return CHKTAG((t), NumberTag); } INLINE_ONLY EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS); -INLINE_ONLY EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS) { +INLINE_ONLY + EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS) { CELL *p = HR; HR[0] = head; @@ -308,20 +323,23 @@ INLINE_ONLY EXTERN inline Term MkPairTerm__(Term head, Term tail USES_REGS) { INLINE_ONLY inline EXTERN Term __MkIntegerTerm(Int USES_REGS); -INLINE_ONLY inline EXTERN Term __MkIntegerTerm(Int n USES_REGS) { +INLINE_ONLY + inline EXTERN Term __MkIntegerTerm(Int n USES_REGS) { return (Term)(IntInBnd(n) ? MkIntTerm(n) : MkLongIntTerm(n)); } #endif INLINE_ONLY inline EXTERN bool IsIntegerTerm(Term); -INLINE_ONLY inline EXTERN bool IsIntegerTerm(Term t) { +INLINE_ONLY + inline EXTERN bool IsIntegerTerm(Term t) { return (int)(IsIntTerm(t) || IsLongIntTerm(t)); } INLINE_ONLY inline EXTERN Int IntegerOfTerm(Term); -INLINE_ONLY inline EXTERN Int IntegerOfTerm(Term t) { +INLINE_ONLY + inline EXTERN Int IntegerOfTerm(Term t) { return (Int)(IsIntTerm(t) ? IntOfTerm(t) : LongIntOfTerm(t)); } @@ -332,7 +350,8 @@ INLINE_ONLY inline EXTERN Int IntegerOfTerm(Term t) { INLINE_ONLY inline EXTERN Term __MkAddressTerm(void *USES_REGS); -INLINE_ONLY inline EXTERN Term __MkAddressTerm(void *n USES_REGS) { +INLINE_ONLY + inline EXTERN Term __MkAddressTerm(void *n USES_REGS) { return __MkIntegerTerm((Int)n PASS_REGS); } @@ -340,20 +359,23 @@ INLINE_ONLY inline EXTERN Term __MkAddressTerm(void *n USES_REGS) { INLINE_ONLY inline EXTERN bool IsAddressTerm(Term); -INLINE_ONLY inline EXTERN bool IsAddressTerm(Term t) { +INLINE_ONLY + inline EXTERN bool IsAddressTerm(Term t) { return (bool)IsIntegerTerm(t); } INLINE_ONLY inline EXTERN void *AddressOfTerm(Term); -INLINE_ONLY inline EXTERN void *AddressOfTerm(Term t) { +INLINE_ONLY + inline EXTERN void *AddressOfTerm(Term t) { return (void *)(IsIntTerm(t) ? IntOfTerm(t) : LongIntOfTerm(t)); } INLINE_ONLY inline EXTERN Int IsPairTermOrNil (Term); -INLINE_ONLY inline EXTERN Int +INLINE_ONLY + inline EXTERN Int IsPairOrNilTerm (Term t) { return IsPairTerm(t) || t == TermNil; diff --git a/H/YapTerm.h b/H/YapTerm.h index e10cd6f50..a7632a379 100644 --- a/H/YapTerm.h +++ b/H/YapTerm.h @@ -33,7 +33,7 @@ typedef void *Atom; (((CELL)(X) + (sizeof(TYPE) - 1)) & ~(sizeof(TYPE) - 1)) #ifndef EXTERN -#ifdef _MSC_VER +#ifdef MSC_VER #define EXTERN #else #define EXTERN extern @@ -44,51 +44,30 @@ typedef void *Atom; ** and integer types Short and UShort with half the size of a ptr */ #if defined(PRIdPTR) -#define Int_FORMAT "%" PRIdPTR -#define Int_ANYFORMAT "%" PRIuPTR -#define UInt_FORMAT "%" PRIuPTR -#define Int_F PRIdPTR -#define Int_ANYF PRIuPTR -#define UInt_F PRIuPTR typedef intptr_t Int; typedef uintptr_t UInt; #elif defined(_WIN64) + typedef int64_t Int; typedef uint64_t UInt; -#define Int_FORMAT "%I64d" -#define UInt_FORMAT "%I64u" -#define Int_F "I64d" -#define UInt_F "I64u" #elif defined(_WIN32) typedef int32_t Int; typedef uint32_t UInt; -#define Int_FORMAT "%I32d" -#define UInt_FORMAT "%I32u" -#define Int_F "I32d" -#define UInt_F "I32u" #elif SIZEOF_LONG_INT == SIZEOF_INT_P typedef long int Int; typedef unsigned long int UInt; -#define Int_FORMAT "%ld" -#define UInt_FORMAT "%uld" -#define Int_F "ld" -#define UInt_F "uld" #elif SIZEOF_INT == SIZEOF_INT_P typedef int Int; typedef unsigned int UInt; -#define Int_FORMAT "%l" -#define UInt_FORMAT "%ul" -#define Int_F "l" -#define UInt_F "ul" #else #error Yap require integer types of the same size as a pointer @@ -107,6 +86,8 @@ typedef uint32_t BITS32; #define CellSize sizeof(CELL) #define SmallSize sizeof(SMALLUNSGN) +#include "YapFormat.h" + /************************************************************************************************* type casting macros *************************************************************************************************/ diff --git a/H/YapText.h b/H/YapText.h index 57f16f969..34b7b9460 100644 --- a/H/YapText.h +++ b/H/YapText.h @@ -31,20 +31,39 @@ #include "../utf8proc/utf8proc.h" #include "Yap.h" +#define ReleaseAndReturn(r) \ + { \ + pop_text_stack(l); \ + return r; \ + } +#define release_cut_fail() \ + { \ + pop_text_stack(l); \ + cut_fail(); \ + } +#define release_cut_succeed() \ + { \ + pop_text_stack(l); \ + cut_succeed(); \ + } + + /// allocate a temporary text block /// extern void *Malloc(size_t sz USES_REGS); extern void *Realloc(void *buf, size_t sz USES_REGS); -extern void Free(void *buf USES_REGS); +extern void Free(void *buf USES_REGS); -extern int push_text_stack( USES_REGS1 ); -extern int pop_text_stack( int lvl USES_REGS ); +extern int push_text_stack(USES_REGS1); +extern int pop_text_stack(int lvl USES_REGS); +extern void *protected_pop_text_stack(int lvl, void *safe, bool tmp, + size_t sz USES_REGS); #ifndef min -#define min(x,y) (x 0) { pt += l; - rc ++; + rc++; } else { pt++; } @@ -294,8 +317,8 @@ inline static int cmpn_utf8(const utf8proc_uint8_t *pt1, #define SURROGATE_OFFSET \ ((uint32_t)0x10000 - (uint32_t)(0xD800 << 10) - (uint32_t)0xDC00) -extern const char *Yap_tokText(void*tokptr); -extern Term Yap_tokRep(void*tokptr); +extern const char *Yap_tokText(void *tokptr); +extern Term Yap_tokRep(void *tokptr); // standard strings @@ -1383,17 +1406,16 @@ static inline Term Yap_UTF8ToString(const char *s USES_REGS) { } static inline Atom UTF32ToAtom(const wchar_t *s USES_REGS) { - seq_tv_t inp, out; - - inp.val.w0 = s; - inp.type = YAP_STRING_WCHARS ; - out.type = YAP_STRING_ATOM; - out.max = -1; - if (!Yap_CVT_Text(&inp, &out PASS_REGS)) - return 0L; - return out.val.a; -} + seq_tv_t inp, out; + inp.val.w0 = s; + inp.type = YAP_STRING_WCHARS; + out.type = YAP_STRING_ATOM; + out.max = -1; + if (!Yap_CVT_Text(&inp, &out PASS_REGS)) + return 0L; + return out.val.a; +} static inline Term Yap_WCharsToListOfCodes(const wchar_t *s USES_REGS) { seq_tv_t inp, out; diff --git a/H/Yapproto.h b/H/Yapproto.h index 5759e71f1..85270a5ef 100755 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -13,12 +13,6 @@ * version: $Id: Yapproto.h,v 1.90 2008-08-07 20:51:23 vsc Exp $ * *************************************************************************/ -#if defined(_WIN32) -#define X_API __declspec(dllexport) -#else -#define X_API -#endif - /* prototype file for Yap */ /* absmi.c */ @@ -309,6 +303,7 @@ extern struct vfs *Yap_InitAssetManager(void); /* load_foreign.c */ extern void Yap_InitLoadForeign(void); +extern bool Yap_LateInit(const char s[]); /* mavar.c */ extern void Yap_InitMaVarCPreds(void); diff --git a/H/absmi.h b/H/absmi.h index 71a01b49b..deb0c78b6 100755 --- a/H/absmi.h +++ b/H/absmi.h @@ -139,7 +139,7 @@ register struct yami *P1REG asm("bp"); /* can't use yamop before Yap.h */ #include "Yap.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #ifdef HAVE_STRING_H #include #endif @@ -2327,6 +2327,8 @@ static inline void prune(choiceptr cp USES_REGS) { if (POP_CHOICE_POINT(B->cp_b)) { POP_EXECUTE(); } + if (B->cp_b == NULL) + break; B = B->cp_b; } if (POP_CHOICE_POINT(B->cp_b)) { @@ -2452,10 +2454,10 @@ extern yamop *headoftrace; ENDD(d0); #endif -#define Yap_AsmError(e, d) \ +#define Yap_AsmError(e, d) \ { \ saveregs(); \ - Yap_ThrowError(e, d, 4, ""); \ + Yap_ThrowError(e, d, "while exwcuting inlined built-in"); \ setregs(); \ } diff --git a/H/blobs.h b/H/blobs.h index cae04601e..0e0f73803 100644 --- a/H/blobs.h +++ b/H/blobs.h @@ -11,7 +11,7 @@ #ifndef BLOBS_H #define BLOBS_H -#ifndef X_API +#if !defined(X_API) && !defined(SWIGYAP) #if (defined(_MSC_VER) || defined(__MINGW32__)) && defined(PL_KERNEL) #define X_API __declspec(dllexport) #else diff --git a/H/generated/dlocals.h b/H/generated/dlocals.h index 2034b0403..0b3f4c025 100644 --- a/H/generated/dlocals.h +++ b/H/generated/dlocals.h @@ -250,6 +250,8 @@ #define LOCAL_nperm LOCAL->nperm_ #define REMOTE_nperm(wid) REMOTE(wid)->nperm_ +#define LOCAL_jMP LOCAL->jMP_ +#define REMOTE_jMP(wid) REMOTE(wid)->jMP_ #define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_ #define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_ diff --git a/H/generated/hlocals.h b/H/generated/hlocals.h index 46a00dad4..470a84605 100644 --- a/H/generated/hlocals.h +++ b/H/generated/hlocals.h @@ -126,7 +126,7 @@ typedef struct worker_local { ADDR db_vec0_; struct RB_red_blk_node* db_root_; struct RB_red_blk_node* db_nil_; - sigjmp_buf gc_restore_; + sigjmp_buf* gc_restore_; CELL* extra_gc_cells_; CELL* extra_gc_cells_base_; CELL* extra_gc_cells_top_; @@ -140,6 +140,7 @@ typedef struct worker_local { UInt CMemFirstBlockSz_; // Variable used by the compiler to store number of permanent vars in a clause int nperm_; + int jMP_; // Thread Local Area for Labels Int* LabelFirstArray_; UInt LabelFirstArraySz_; @@ -166,7 +167,7 @@ typedef struct worker_local { /* error handling info, designed to be easy to pass to the foreign world */ yap_error_descriptor_t* ActiveError_; /// pointer to an exception term, from throw - jmp_buf IOBotch_; + jmp_buf* IOBotch_; TokEntry* tokptr_; TokEntry* toktide_; VarEntry* VarTable_; @@ -177,7 +178,7 @@ typedef struct worker_local { wchar_t* CommentsBuff_; size_t CommentsBuffPos_; size_t CommentsBuffLim_; - sigjmp_buf RestartEnv_; + sigjmp_buf* RestartEnv_; char FileNameBuf_[YAP_FILENAME_MAX+1]; char FileNameBuf2_[YAP_FILENAME_MAX+1]; struct TextBuffer_manager* TextBuffer_; diff --git a/H/generated/iatoms.h b/H/generated/iatoms.h index 9ebbb212f..180728605 100644 --- a/H/generated/iatoms.h +++ b/H/generated/iatoms.h @@ -1,581 +1,584 @@ - - /* This file, iatoms.h, was generated automatically by "yap -L misc/buildatoms" - {lease do not update, update misc/ATOMS instead */ - - Atom3Dots = Yap_LookupAtom("..."); - AtomAbol = Yap_FullLookupAtom("$abol"); TermAbol = MkAtomTerm(AtomAbol); - AtomAccess = Yap_LookupAtom("access"); TermAccess = MkAtomTerm(AtomAccess); - AtomAfInet = Yap_LookupAtom("AF_INET"); TermAfInet = MkAtomTerm(AtomAfInet); - AtomAfLocal = Yap_LookupAtom("AF_LOCAL"); TermAfLocal = MkAtomTerm(AtomAfLocal); - AtomAfUnix = Yap_LookupAtom("AF_UNIX"); TermAfUnix = MkAtomTerm(AtomAfUnix); - AtomAlarm = Yap_FullLookupAtom("$alarm"); TermAlarm = MkAtomTerm(AtomAlarm); - AtomAlias = Yap_LookupAtom("alias"); TermAlias = MkAtomTerm(AtomAlias); - AtomAll = Yap_LookupAtom("all"); TermAll = MkAtomTerm(AtomAll); - AtomAltNot = Yap_LookupAtom("not"); TermAltNot = MkAtomTerm(AtomAltNot); - AtomAnswer = Yap_LookupAtom("answer"); TermAnswer = MkAtomTerm(AtomAnswer); - AtomAny = Yap_LookupAtom("any"); TermAny = MkAtomTerm(AtomAny); - AtomAppend = Yap_LookupAtom("append"); TermAppend = MkAtomTerm(AtomAppend); - AtomArg = Yap_LookupAtom("arg"); TermArg = MkAtomTerm(AtomArg); - AtomArray = Yap_FullLookupAtom("$array"); TermArray = MkAtomTerm(AtomArray); - AtomArrayAccess = Yap_FullLookupAtom("$array_arg"); TermArrayAccess = MkAtomTerm(AtomArrayAccess); - AtomArrayOverflow = Yap_LookupAtom("array_overflow"); TermArrayOverflow = MkAtomTerm(AtomArrayOverflow); - AtomArrayType = Yap_LookupAtom("array_type"); TermArrayType = MkAtomTerm(AtomArrayType); - AtomArrow = Yap_LookupAtom("->"); TermArrow = MkAtomTerm(AtomArrow); - AtomAttributedModule = Yap_LookupAtom("attributes_module"); TermAttributedModule = MkAtomTerm(AtomAttributedModule); - AtomDoubleArrow = Yap_LookupAtom("-->"); TermDoubleArrow = MkAtomTerm(AtomDoubleArrow); - AtomAssert = Yap_LookupAtom(":-"); TermAssert = MkAtomTerm(AtomAssert); - AtomBeginBracket = Yap_LookupAtom("("); TermBeginBracket = MkAtomTerm(AtomBeginBracket); - AtomEndBracket = Yap_LookupAtom(")"); TermEndBracket = MkAtomTerm(AtomEndBracket); - AtomBeginSquareBracket = Yap_LookupAtom("["); TermBeginSquareBracket = MkAtomTerm(AtomBeginSquareBracket); - AtomEndSquareBracket = Yap_LookupAtom("]"); TermEndSquareBracket = MkAtomTerm(AtomEndSquareBracket); - AtomBeginCurlyBracket = Yap_LookupAtom("{"); TermBeginCurlyBracket = MkAtomTerm(AtomBeginCurlyBracket); - AtomEndCurlyBracket = Yap_LookupAtom("}"); TermEndCurlyBracket = MkAtomTerm(AtomEndCurlyBracket); - AtomEmptyBrackets = Yap_LookupAtom("()"); TermEmptyBrackets = MkAtomTerm(AtomEmptyBrackets); - AtomEmptySquareBrackets = Yap_LookupAtom("[]"); TermEmptySquareBrackets = MkAtomTerm(AtomEmptySquareBrackets); - AtomAsserta = Yap_LookupAtom("asserta"); TermAsserta = MkAtomTerm(AtomAsserta); - AtomAssertaStatic = Yap_LookupAtom("asserta_static"); TermAssertaStatic = MkAtomTerm(AtomAssertaStatic); - AtomAssertz = Yap_LookupAtom("assertz"); TermAssertz = MkAtomTerm(AtomAssertz); - AtomAssertzStatic = Yap_LookupAtom("assertz_static"); TermAssertzStatic = MkAtomTerm(AtomAssertzStatic); - AtomAt = Yap_LookupAtom("at"); TermAt = MkAtomTerm(AtomAt); - AtomAtom = Yap_LookupAtom("atom"); TermAtom = MkAtomTerm(AtomAtom); - AtomAtomic = Yap_LookupAtom("atomic"); TermAtomic = MkAtomTerm(AtomAtomic); - AtomAtt = Yap_FullLookupAtom("$att"); TermAtt = MkAtomTerm(AtomAtt); - AtomAtt1 = Yap_LookupAtom("att"); TermAtt1 = MkAtomTerm(AtomAtt1); - AtomAttDo = Yap_FullLookupAtom("$att_do"); TermAttDo = MkAtomTerm(AtomAttDo); - AtomAttributes = Yap_LookupAtom("attributes"); TermAttributes = MkAtomTerm(AtomAttributes); - AtomB = Yap_FullLookupAtom("$last_choice_pt"); TermB = MkAtomTerm(AtomB); - AtomBatched = Yap_LookupAtom("batched"); TermBatched = MkAtomTerm(AtomBatched); - AtomBetween = Yap_LookupAtom("between"); TermBetween = MkAtomTerm(AtomBetween); - AtomBinary = Yap_LookupAtom("binary"); TermBinary = MkAtomTerm(AtomBinary); - AtomBigNum = Yap_LookupAtom("big_num"); TermBigNum = MkAtomTerm(AtomBigNum); - AtomBinaryStream = Yap_LookupAtom("binary_stream"); TermBinaryStream = MkAtomTerm(AtomBinaryStream); - AtomBoolean = Yap_LookupAtom("boolean"); TermBoolean = MkAtomTerm(AtomBoolean); - AtomBraces = Yap_LookupAtom("{}"); TermBraces = MkAtomTerm(AtomBraces); - AtomBreak = Yap_FullLookupAtom("$break"); TermBreak = MkAtomTerm(AtomBreak); - AtomByte = Yap_LookupAtom("byte"); TermByte = MkAtomTerm(AtomByte); - AtomCArith = Yap_FullLookupAtom("$c_arith"); TermCArith = MkAtomTerm(AtomCArith); - AtomCall = Yap_LookupAtom("call"); TermCall = MkAtomTerm(AtomCall); - AtomCallAndRetryCounter = Yap_LookupAtom("call_and_retry_counter"); TermCallAndRetryCounter = MkAtomTerm(AtomCallAndRetryCounter); - AtomCallCounter = Yap_LookupAtom("call_counter"); TermCallCounter = MkAtomTerm(AtomCallCounter); - AtomCallable = Yap_LookupAtom("callable"); TermCallable = MkAtomTerm(AtomCallable); - AtomCatch = Yap_FullLookupAtom("$catch"); TermCatch = MkAtomTerm(AtomCatch); - AtomChangeModule = Yap_FullLookupAtom("$change_module"); TermChangeModule = MkAtomTerm(AtomChangeModule); - AtomChar = Yap_LookupAtom("char"); TermChar = MkAtomTerm(AtomChar); - AtomCharsio = Yap_LookupAtom("charsio"); TermCharsio = MkAtomTerm(AtomCharsio); - AtomCharacter = Yap_LookupAtom("character"); TermCharacter = MkAtomTerm(AtomCharacter); - AtomCharacterCode = Yap_LookupAtom("character_code"); TermCharacterCode = MkAtomTerm(AtomCharacterCode); - AtomChars = Yap_LookupAtom("chars"); TermChars = MkAtomTerm(AtomChars); - AtomCharset = Yap_LookupAtom("charset"); TermCharset = MkAtomTerm(AtomCharset); - AtomChType = Yap_FullLookupAtom("$char_type"); TermChType = MkAtomTerm(AtomChType); - AtomCleanCall = Yap_FullLookupAtom("$clean_call"); TermCleanCall = MkAtomTerm(AtomCleanCall); - AtomClose = Yap_LookupAtom("close"); TermClose = MkAtomTerm(AtomClose); - AtomColon = Yap_LookupAtom(":"); TermColon = MkAtomTerm(AtomColon); - AtomCodeSpace = Yap_LookupAtom("code_space"); TermCodeSpace = MkAtomTerm(AtomCodeSpace); - AtomCodes = Yap_LookupAtom("codes"); TermCodes = MkAtomTerm(AtomCodes); - AtomCoInductive = Yap_LookupAtom("coinductive"); TermCoInductive = MkAtomTerm(AtomCoInductive); - AtomComma = Yap_LookupAtom(","); TermComma = MkAtomTerm(AtomComma); - AtomCommentHook = Yap_LookupAtom("comment_hook"); TermCommentHook = MkAtomTerm(AtomCommentHook); - AtomCompact = Yap_LookupAtom("compact"); TermCompact = MkAtomTerm(AtomCompact); - AtomCompound = Yap_LookupAtom("compound"); TermCompound = MkAtomTerm(AtomCompound); - AtomConsistencyError = Yap_LookupAtom("consistency_error"); TermConsistencyError = MkAtomTerm(AtomConsistencyError); - AtomConsult = Yap_LookupAtom("consult"); TermConsult = MkAtomTerm(AtomConsult); - AtomConsultOnBoot = Yap_FullLookupAtom("$consult_on_boot"); TermConsultOnBoot = MkAtomTerm(AtomConsultOnBoot); - AtomContext = Yap_LookupAtom("context"); TermContext = MkAtomTerm(AtomContext); - AtomCputime = Yap_LookupAtom("cputime"); TermCputime = MkAtomTerm(AtomCputime); - AtomCreate = Yap_LookupAtom("create"); TermCreate = MkAtomTerm(AtomCreate); - AtomCreep = Yap_FullLookupAtom("$creep"); TermCreep = MkAtomTerm(AtomCreep); - AtomCryptAtoms = Yap_LookupAtom("crypt_atoms"); TermCryptAtoms = MkAtomTerm(AtomCryptAtoms); - AtomCurly = Yap_LookupAtom("{}"); TermCurly = MkAtomTerm(AtomCurly); - AtomCsult = Yap_FullLookupAtom("$csult"); TermCsult = MkAtomTerm(AtomCsult); - AtomCurrentModule = Yap_FullLookupAtom("$current_module"); TermCurrentModule = MkAtomTerm(AtomCurrentModule); - AtomCut = Yap_LookupAtom("!"); TermCut = MkAtomTerm(AtomCut); - AtomCutBy = Yap_FullLookupAtom("$cut_by"); TermCutBy = MkAtomTerm(AtomCutBy); - AtomDAbort = Yap_FullLookupAtom("$abort"); TermDAbort = MkAtomTerm(AtomDAbort); - AtomDBLoad = Yap_FullLookupAtom("$db_load"); TermDBLoad = MkAtomTerm(AtomDBLoad); - AtomDBREF = Yap_LookupAtom("DBRef"); TermDBREF = MkAtomTerm(AtomDBREF); - AtomDBReference = Yap_LookupAtom("db_reference"); TermDBReference = MkAtomTerm(AtomDBReference); - AtomDBTerm = Yap_LookupAtom("db_term"); TermDBTerm = MkAtomTerm(AtomDBTerm); - AtomDBref = Yap_FullLookupAtom("$dbref"); TermDBref = MkAtomTerm(AtomDBref); - AtomDInteger = Yap_FullLookupAtom("$integer"); TermDInteger = MkAtomTerm(AtomDInteger); - AtomDebugMeta = Yap_FullLookupAtom("$debug_meta"); TermDebugMeta = MkAtomTerm(AtomDebugMeta); - AtomDebuggerInput = Yap_LookupAtom("debugger_input"); TermDebuggerInput = MkAtomTerm(AtomDebuggerInput); - AtomDec10 = Yap_LookupAtom("dec10"); TermDec10 = MkAtomTerm(AtomDec10); - AtomDefault = Yap_LookupAtom("default"); TermDefault = MkAtomTerm(AtomDefault); - AtomDevNull = Yap_LookupAtom("/dev/null"); TermDevNull = MkAtomTerm(AtomDevNull); - AtomDiff = Yap_LookupAtom("\\="); TermDiff = MkAtomTerm(AtomDiff); - AtomDirectory = Yap_LookupAtom("disrectorys"); TermDirectory = MkAtomTerm(AtomDirectory); - AtomDiscontiguous = Yap_LookupAtom("discontiguous"); TermDiscontiguous = MkAtomTerm(AtomDiscontiguous); - AtomDiscontiguousWarnings = Yap_LookupAtom("discontiguous_warnings"); TermDiscontiguousWarnings = MkAtomTerm(AtomDiscontiguousWarnings); - AtomDollar = Yap_FullLookupAtom("$"); TermDollar = MkAtomTerm(AtomDollar); - AtomDoLogUpdClause = Yap_FullLookupAtom("$do_log_upd_clause"); TermDoLogUpdClause = MkAtomTerm(AtomDoLogUpdClause); - AtomDoLogUpdClause0 = Yap_FullLookupAtom("$do_log_upd_clause0"); TermDoLogUpdClause0 = MkAtomTerm(AtomDoLogUpdClause0); - AtomDoLogUpdClauseErase = Yap_FullLookupAtom("$do_log_upd_clause_erase"); TermDoLogUpdClauseErase = MkAtomTerm(AtomDoLogUpdClauseErase); - AtomDollarU = Yap_FullLookupAtom("$u"); TermDollarU = MkAtomTerm(AtomDollarU); - AtomDollarUndef = Yap_FullLookupAtom("$undef"); TermDollarUndef = MkAtomTerm(AtomDollarUndef); - AtomDomainError = Yap_LookupAtom("domain_error"); TermDomainError = MkAtomTerm(AtomDomainError); - AtomDoStaticClause = Yap_FullLookupAtom("$do_static_clause"); TermDoStaticClause = MkAtomTerm(AtomDoStaticClause); - AtomDots = Yap_LookupAtom("dots"); TermDots = MkAtomTerm(AtomDots); - AtomDOUBLE = Yap_FullLookupAtom("Double"); TermDOUBLE = MkAtomTerm(AtomDOUBLE); - AtomDoubleSlash = Yap_FullLookupAtom("//"); TermDoubleSlash = MkAtomTerm(AtomDoubleSlash); - AtomE = Yap_LookupAtom("e"); TermE = MkAtomTerm(AtomE); - AtomEOFBeforeEOT = Yap_LookupAtom("end_of_file_found_before_end_of_term"); TermEOFBeforeEOT = MkAtomTerm(AtomEOFBeforeEOT); - AtomEQ = Yap_LookupAtom("="); TermEQ = MkAtomTerm(AtomEQ); - AtomEmptyAtom = Yap_LookupAtom(""); TermEmptyAtom = MkAtomTerm(AtomEmptyAtom); - AtomEncoding = Yap_LookupAtom("encoding"); TermEncoding = MkAtomTerm(AtomEncoding); - AtomEndOfStream = Yap_LookupAtom("$end_of_stream"); TermEndOfStream = MkAtomTerm(AtomEndOfStream); - AtomEof = Yap_LookupAtom("end_of_file"); TermEof = MkAtomTerm(AtomEof); - AtomEOfCode = Yap_LookupAtom("eof_code"); TermEOfCode = MkAtomTerm(AtomEOfCode); - AtomEq = Yap_LookupAtom("="); TermEq = MkAtomTerm(AtomEq); - AtomError = Yap_LookupAtom("error"); TermError = MkAtomTerm(AtomError); - AtomException = Yap_LookupAtom("exception"); TermException = MkAtomTerm(AtomException); - AtomExtensions = Yap_LookupAtom("extensions"); TermExtensions = MkAtomTerm(AtomExtensions); - AtomEvaluable = Yap_LookupAtom("evaluable"); TermEvaluable = MkAtomTerm(AtomEvaluable); - AtomEvaluationError = Yap_LookupAtom("evaluation_error"); TermEvaluationError = MkAtomTerm(AtomEvaluationError); - AtomExecutable = Yap_LookupAtom("executable"); TermExecutable = MkAtomTerm(AtomExecutable); - AtomExecute = Yap_LookupAtom("execute"); TermExecute = MkAtomTerm(AtomExecute); - AtomExecAnswers = Yap_LookupAtom("exec_answers"); TermExecAnswers = MkAtomTerm(AtomExecAnswers); - AtomExecuteInMod = Yap_FullLookupAtom("$execute_in_mod"); TermExecuteInMod = MkAtomTerm(AtomExecuteInMod); - AtomExecuteWithin = Yap_FullLookupAtom("$execute_within"); TermExecuteWithin = MkAtomTerm(AtomExecuteWithin); - AtomExecuteWoMod = Yap_FullLookupAtom("$execute_wo_mod"); TermExecuteWoMod = MkAtomTerm(AtomExecuteWoMod); - AtomExist = Yap_LookupAtom("exist"); TermExist = MkAtomTerm(AtomExist); - AtomExists = Yap_LookupAtom("exists"); TermExists = MkAtomTerm(AtomExists); - AtomExit = Yap_LookupAtom("exit"); TermExit = MkAtomTerm(AtomExit); - AtomExistenceError = Yap_LookupAtom("existence_error"); TermExistenceError = MkAtomTerm(AtomExistenceError); - AtomExoClause = Yap_FullLookupAtom("$exo_clause"); TermExoClause = MkAtomTerm(AtomExoClause); - AtomExpectedNumber = Yap_LookupAtom("expected_number_syntax"); TermExpectedNumber = MkAtomTerm(AtomExpectedNumber); - AtomExpand = Yap_LookupAtom("expand"); TermExpand = MkAtomTerm(AtomExpand); - AtomExtendFileSearchPath = Yap_FullLookupAtom("$extend_file_search_path"); TermExtendFileSearchPath = MkAtomTerm(AtomExtendFileSearchPath); - AtomExtendsions = Yap_LookupAtom("extensionh"); TermExtendsions = MkAtomTerm(AtomExtendsions); - AtomFB = Yap_LookupAtom("fb"); TermFB = MkAtomTerm(AtomFB); - AtomFail = Yap_LookupAtom("fail"); TermFail = MkAtomTerm(AtomFail); - AtomFalse = Yap_LookupAtom("false"); TermFalse = MkAtomTerm(AtomFalse); - AtomFast = Yap_FullLookupAtom("$fast"); TermFast = MkAtomTerm(AtomFast); - AtomFastFail = Yap_LookupAtom("fast_fail"); TermFastFail = MkAtomTerm(AtomFastFail); - AtomFileErrors = Yap_LookupAtom("file_errors"); TermFileErrors = MkAtomTerm(AtomFileErrors); - AtomFileerrors = Yap_LookupAtom("fileerrors"); TermFileerrors = MkAtomTerm(AtomFileerrors); - AtomFileType = Yap_LookupAtom("file_type"); TermFileType = MkAtomTerm(AtomFileType); - AtomFirst = Yap_LookupAtom("first"); TermFirst = MkAtomTerm(AtomFirst); - AtomFloat = Yap_LookupAtom("float"); TermFloat = MkAtomTerm(AtomFloat); - AtomFloatFormat = Yap_LookupAtom("\%.15g"); TermFloatFormat = MkAtomTerm(AtomFloatFormat); - AtomFloatOverflow = Yap_LookupAtom("float_overflow"); TermFloatOverflow = MkAtomTerm(AtomFloatOverflow); - AtomFloatUnderflow = Yap_LookupAtom("float_underflow"); TermFloatUnderflow = MkAtomTerm(AtomFloatUnderflow); - AtomFormat = Yap_LookupAtom("format"); TermFormat = MkAtomTerm(AtomFormat); - AtomFormatAt = Yap_FullLookupAtom("$format@"); TermFormatAt = MkAtomTerm(AtomFormatAt); - AtomFull = Yap_LookupAtom("full"); TermFull = MkAtomTerm(AtomFull); - AtomFunctor = Yap_LookupAtom("functor"); TermFunctor = MkAtomTerm(AtomFunctor); - AtomGT = Yap_LookupAtom(">"); TermGT = MkAtomTerm(AtomGT); - AtomGVar = Yap_LookupAtom("var"); TermGVar = MkAtomTerm(AtomGVar); - AtomGc = Yap_FullLookupAtom("$gc"); TermGc = MkAtomTerm(AtomGc); - AtomGcMargin = Yap_FullLookupAtom("$gc_margin"); TermGcMargin = MkAtomTerm(AtomGcMargin); - AtomGcTrace = Yap_FullLookupAtom("$gc_trace"); TermGcTrace = MkAtomTerm(AtomGcTrace); - AtomGcVerbose = Yap_FullLookupAtom("$gc_verbose"); TermGcVerbose = MkAtomTerm(AtomGcVerbose); - AtomGcVeryVerbose = Yap_FullLookupAtom("$gc_very_verbose"); TermGcVeryVerbose = MkAtomTerm(AtomGcVeryVerbose); - AtomGeneratePredInfo = Yap_FullLookupAtom("$generate_pred_info"); TermGeneratePredInfo = MkAtomTerm(AtomGeneratePredInfo); - AtomGetwork = Yap_FullLookupAtom("$getwork"); TermGetwork = MkAtomTerm(AtomGetwork); - AtomGetworkSeq = Yap_FullLookupAtom("$getwork_seq"); TermGetworkSeq = MkAtomTerm(AtomGetworkSeq); - AtomGlob = Yap_LookupAtom("glob"); TermGlob = MkAtomTerm(AtomGlob); - AtomGlobal = Yap_LookupAtom("global"); TermGlobal = MkAtomTerm(AtomGlobal); - AtomGlobalSp = Yap_LookupAtom("global_sp"); TermGlobalSp = MkAtomTerm(AtomGlobalSp); - AtomGlobalTrie = Yap_LookupAtom("global_trie"); TermGlobalTrie = MkAtomTerm(AtomGlobalTrie); - AtomGoalExpansion = Yap_LookupAtom("goal_expansion"); TermGoalExpansion = MkAtomTerm(AtomGoalExpansion); - AtomHat = Yap_LookupAtom("^"); TermHat = MkAtomTerm(AtomHat); - AtomHERE = Yap_LookupAtom("\n <====HERE====> \n"); TermHERE = MkAtomTerm(AtomHERE); - AtomHandleThrow = Yap_FullLookupAtom("$handle_throw"); TermHandleThrow = MkAtomTerm(AtomHandleThrow); - AtomHeap = Yap_LookupAtom("heap"); TermHeap = MkAtomTerm(AtomHeap); - AtomHeapUsed = Yap_LookupAtom("heapused"); TermHeapUsed = MkAtomTerm(AtomHeapUsed); - AtomHugeInt = Yap_LookupAtom("huge_int"); TermHugeInt = MkAtomTerm(AtomHugeInt); - AtomIDB = Yap_LookupAtom("idb"); TermIDB = MkAtomTerm(AtomIDB); - AtomIOMode = Yap_LookupAtom("io_mode"); TermIOMode = MkAtomTerm(AtomIOMode); - AtomI = Yap_LookupAtom("i"); TermI = MkAtomTerm(AtomI); - AtomId = Yap_LookupAtom("id"); TermId = MkAtomTerm(AtomId); - AtomIgnore = Yap_LookupAtom("ignore"); TermIgnore = MkAtomTerm(AtomIgnore); - AtomInf = Yap_LookupAtom("inf"); TermInf = MkAtomTerm(AtomInf); - AtomInfinity = Yap_LookupAtom("infinity"); TermInfinity = MkAtomTerm(AtomInfinity); - AtomInfo = Yap_LookupAtom("info"); TermInfo = MkAtomTerm(AtomInfo); - AtomInitGoal = Yap_FullLookupAtom("$init_goal"); TermInitGoal = MkAtomTerm(AtomInitGoal); - AtomInitProlog = Yap_FullLookupAtom("$init_prolog"); TermInitProlog = MkAtomTerm(AtomInitProlog); - AtomInStackExpansion = Yap_LookupAtom("in stack expansion"); TermInStackExpansion = MkAtomTerm(AtomInStackExpansion); - AtomInput = Yap_LookupAtom("input"); TermInput = MkAtomTerm(AtomInput); - AtomInstantiationError = Yap_LookupAtom("instantiation_error"); TermInstantiationError = MkAtomTerm(AtomInstantiationError); - AtomInt = Yap_LookupAtom("int"); TermInt = MkAtomTerm(AtomInt); - AtomIntOverflow = Yap_LookupAtom("int_overflow"); TermIntOverflow = MkAtomTerm(AtomIntOverflow); - AtomInteger = Yap_LookupAtom("integer"); TermInteger = MkAtomTerm(AtomInteger); - AtomInternalCompilerError = Yap_LookupAtom("internal_compiler_error"); TermInternalCompilerError = MkAtomTerm(AtomInternalCompilerError); - AtomIs = Yap_LookupAtom("is"); TermIs = MkAtomTerm(AtomIs); - AtomJ = Yap_LookupAtom("j"); TermJ = MkAtomTerm(AtomJ); - Atoml = Yap_LookupAtom("l"); Terml = MkAtomTerm(Atoml); - AtomKey = Yap_LookupAtom("key"); TermKey = MkAtomTerm(AtomKey); - AtomLDLibraryPath = Yap_LookupAtom("LD_LIBRARY_PATH"); TermLDLibraryPath = MkAtomTerm(AtomLDLibraryPath); - AtomLONGINT = Yap_LookupAtom("LongInt"); TermLONGINT = MkAtomTerm(AtomLONGINT); - AtomLOOP = Yap_LookupAtom("_LOOP_"); TermLOOP = MkAtomTerm(AtomLOOP); - AtomLoopStream = Yap_LookupAtom("loop_stream"); TermLoopStream = MkAtomTerm(AtomLoopStream); - AtomLT = Yap_LookupAtom("<"); TermLT = MkAtomTerm(AtomLT); - AtomLastExecuteWithin = Yap_FullLookupAtom("$last_execute_within"); TermLastExecuteWithin = MkAtomTerm(AtomLastExecuteWithin); - AtomLeash = Yap_FullLookupAtom("$leash"); TermLeash = MkAtomTerm(AtomLeash); - AtomLeast = Yap_LookupAtom("least"); TermLeast = MkAtomTerm(AtomLeast); - AtomLength = Yap_FullLookupAtom("length"); TermLength = MkAtomTerm(AtomLength); - AtomList = Yap_LookupAtom("list"); TermList = MkAtomTerm(AtomList); - AtomLine = Yap_LookupAtom("line"); TermLine = MkAtomTerm(AtomLine); - AtomLive = Yap_FullLookupAtom("$live"); TermLive = MkAtomTerm(AtomLive); - AtomLoadAnswers = Yap_LookupAtom("load_answers"); TermLoadAnswers = MkAtomTerm(AtomLoadAnswers); - AtomLocal = Yap_LookupAtom("local"); TermLocal = MkAtomTerm(AtomLocal); - AtomLocalSp = Yap_LookupAtom("local_sp"); TermLocalSp = MkAtomTerm(AtomLocalSp); - AtomLocalTrie = Yap_LookupAtom("local_trie"); TermLocalTrie = MkAtomTerm(AtomLocalTrie); - AtomMax = Yap_LookupAtom("max"); TermMax = MkAtomTerm(AtomMax); - AtomMaximum = Yap_LookupAtom("maximum"); TermMaximum = MkAtomTerm(AtomMaximum); - AtomMaxArity = Yap_LookupAtom("max_arity"); TermMaxArity = MkAtomTerm(AtomMaxArity); - AtomMaxFiles = Yap_LookupAtom("max_files"); TermMaxFiles = MkAtomTerm(AtomMaxFiles); - AtomMegaClause = Yap_FullLookupAtom("$mega_clause"); TermMegaClause = MkAtomTerm(AtomMegaClause); - AtomMetaCall = Yap_FullLookupAtom("$call"); TermMetaCall = MkAtomTerm(AtomMetaCall); - AtomMfClause = Yap_FullLookupAtom("$mf_clause"); TermMfClause = MkAtomTerm(AtomMfClause); - AtomMin = Yap_LookupAtom("min"); TermMin = MkAtomTerm(AtomMin); - AtomMinimum = Yap_LookupAtom("minimum"); TermMinimum = MkAtomTerm(AtomMinimum); - AtomMinus = Yap_LookupAtom("-"); TermMinus = MkAtomTerm(AtomMinus); - AtomModify = Yap_LookupAtom("modify"); TermModify = MkAtomTerm(AtomModify); - AtomModule = Yap_LookupAtom("module"); TermModule = MkAtomTerm(AtomModule); - AtomMost = Yap_LookupAtom("most"); TermMost = MkAtomTerm(AtomMost); - AtomMulti = Yap_LookupAtom("multi"); TermMulti = MkAtomTerm(AtomMulti); - AtomMultiFile = Yap_FullLookupAtom("$mf"); TermMultiFile = MkAtomTerm(AtomMultiFile); - AtomMultiple = Yap_FullLookupAtom("multiple"); TermMultiple = MkAtomTerm(AtomMultiple); - AtomMutable = Yap_LookupAtom("mutable"); TermMutable = MkAtomTerm(AtomMutable); - AtomMutableVariable = Yap_FullLookupAtom("$mutable_variable"); TermMutableVariable = MkAtomTerm(AtomMutableVariable); - AtomMutex = Yap_LookupAtom("mutex"); TermMutex = MkAtomTerm(AtomMutex); - AtomMyddasDB = Yap_FullLookupAtom("$myddas_db"); TermMyddasDB = MkAtomTerm(AtomMyddasDB); - AtomMyddasGoal = Yap_FullLookupAtom("$myddas_goal"); TermMyddasGoal = MkAtomTerm(AtomMyddasGoal); - AtomMyddasHost = Yap_FullLookupAtom("$myddas_host"); TermMyddasHost = MkAtomTerm(AtomMyddasHost); - AtomMyddasPass = Yap_FullLookupAtom("$myddas_pass"); TermMyddasPass = MkAtomTerm(AtomMyddasPass); - AtomMyddasUser = Yap_FullLookupAtom("$myddas_user"); TermMyddasUser = MkAtomTerm(AtomMyddasUser); - AtomMyddasVersionName = Yap_FullLookupAtom("$myddas_version_name"); TermMyddasVersionName = MkAtomTerm(AtomMyddasVersionName); - AtomNan = Yap_LookupAtom("nan"); TermNan = MkAtomTerm(AtomNan); - AtomNb = Yap_LookupAtom("nb"); TermNb = MkAtomTerm(AtomNb); - AtomNbTerm = Yap_LookupAtom("nb_term"); TermNbTerm = MkAtomTerm(AtomNbTerm); - AtomNew = Yap_LookupAtom("new"); TermNew = MkAtomTerm(AtomNew); - AtomNewLine = Yap_LookupAtom("nl"); TermNewLine = MkAtomTerm(AtomNewLine); - AtomNl = Yap_LookupAtom("nl"); TermNl = MkAtomTerm(AtomNl); - AtomNoEffect = Yap_LookupAtom("no_effect"); TermNoEffect = MkAtomTerm(AtomNoEffect); - AtomNoMemory = Yap_LookupAtom("no_memory"); TermNoMemory = MkAtomTerm(AtomNoMemory); - AtomNone = Yap_LookupAtom("none"); TermNone = MkAtomTerm(AtomNone); - AtomNonEmptyList = Yap_LookupAtom("non_empty_list"); TermNonEmptyList = MkAtomTerm(AtomNonEmptyList); - AtomNot = Yap_LookupAtom("\\+"); TermNot = MkAtomTerm(AtomNot); - AtomNotImplemented = Yap_LookupAtom("not_implemented"); TermNotImplemented = MkAtomTerm(AtomNotImplemented); - AtomNotLessThanZero = Yap_LookupAtom("not_less_than_zero"); TermNotLessThanZero = MkAtomTerm(AtomNotLessThanZero); - AtomNotNewline = Yap_LookupAtom("not_newline"); TermNotNewline = MkAtomTerm(AtomNotNewline); - AtomNotZero = Yap_LookupAtom("not_zero"); TermNotZero = MkAtomTerm(AtomNotZero); - AtomNumber = Yap_LookupAtom("number"); TermNumber = MkAtomTerm(AtomNumber); - AtomObj = Yap_LookupAtom("o__bj__"); TermObj = MkAtomTerm(AtomObj); - AtomOff = Yap_LookupAtom("off"); TermOff = MkAtomTerm(AtomOff); - AtomOffline = Yap_LookupAtom("offline"); TermOffline = MkAtomTerm(AtomOffline); - AtomOn = Yap_LookupAtom("on"); TermOn = MkAtomTerm(AtomOn); - AtomOnline = Yap_LookupAtom("online"); TermOnline = MkAtomTerm(AtomOnline); - AtomOpen = Yap_LookupAtom("open"); TermOpen = MkAtomTerm(AtomOpen); - AtomOperatingSystemError = Yap_LookupAtom("operating_SYSTEM_ERROR_INTERNAL"); TermOperatingSystemError = MkAtomTerm(AtomOperatingSystemError); - AtomOperatingSystemSupport = Yap_LookupAtom("operating_system_support"); TermOperatingSystemSupport = MkAtomTerm(AtomOperatingSystemSupport); - AtomOperator = Yap_LookupAtom("operator"); TermOperator = MkAtomTerm(AtomOperator); - AtomOperatorPriority = Yap_LookupAtom("operator_priority"); TermOperatorPriority = MkAtomTerm(AtomOperatorPriority); - AtomOperatorSpecifier = Yap_LookupAtom("operator_specifier"); TermOperatorSpecifier = MkAtomTerm(AtomOperatorSpecifier); - AtomOpt = Yap_LookupAtom("opt"); TermOpt = MkAtomTerm(AtomOpt); - AtomOtherwise = Yap_LookupAtom("otherwise"); TermOtherwise = MkAtomTerm(AtomOtherwise); - AtomOutOfAttvarsError = Yap_LookupAtom("out_of_attvars_error"); TermOutOfAttvarsError = MkAtomTerm(AtomOutOfAttvarsError); - AtomOutOfAuxspaceError = Yap_LookupAtom("out_of_auxspace_error"); TermOutOfAuxspaceError = MkAtomTerm(AtomOutOfAuxspaceError); - AtomOutOfHeapError = Yap_LookupAtom("out_of_heap_error"); TermOutOfHeapError = MkAtomTerm(AtomOutOfHeapError); - AtomOutOfRange = Yap_LookupAtom("out_of_range"); TermOutOfRange = MkAtomTerm(AtomOutOfRange); - AtomOutOfStackError = Yap_LookupAtom("out_of_stack_error"); TermOutOfStackError = MkAtomTerm(AtomOutOfStackError); - AtomOutOfTrailError = Yap_LookupAtom("out_of_trail_error"); TermOutOfTrailError = MkAtomTerm(AtomOutOfTrailError); - AtomOutput = Yap_LookupAtom("output"); TermOutput = MkAtomTerm(AtomOutput); - AtomParameter = Yap_LookupAtom("parameter"); TermParameter = MkAtomTerm(AtomParameter); - AtomPrologCommonsDir = Yap_LookupAtom("prolog_commons_directory"); TermPrologCommonsDir = MkAtomTerm(AtomPrologCommonsDir); - AtomPast = Yap_LookupAtom("past"); TermPast = MkAtomTerm(AtomPast); - AtomPastEndOfStream = Yap_LookupAtom("past_end_of_stream"); TermPastEndOfStream = MkAtomTerm(AtomPastEndOfStream); - AtomPermissionError = Yap_LookupAtom("permission_error"); TermPermissionError = MkAtomTerm(AtomPermissionError); - AtomPi = Yap_LookupAtom("pi"); TermPi = MkAtomTerm(AtomPi); - AtomPipe = Yap_LookupAtom("pipe"); TermPipe = MkAtomTerm(AtomPipe); - AtomPlus = Yap_LookupAtom("+"); TermPlus = MkAtomTerm(AtomPlus); - AtomPointer = Yap_LookupAtom("pointer"); TermPointer = MkAtomTerm(AtomPointer); - AtomPortray = Yap_FullLookupAtom("portray"); TermPortray = MkAtomTerm(AtomPortray); - AtomPredicateIndicator = Yap_LookupAtom("predicate_indicator"); TermPredicateIndicator = MkAtomTerm(AtomPredicateIndicator); - AtomPrimitive = Yap_LookupAtom("primitive"); TermPrimitive = MkAtomTerm(AtomPrimitive); - AtomPrintMessage = Yap_LookupAtom("print_message"); TermPrintMessage = MkAtomTerm(AtomPrintMessage); - AtomPrivateProcedure = Yap_LookupAtom("private_procedure"); TermPrivateProcedure = MkAtomTerm(AtomPrivateProcedure); - AtomProcedure = Yap_LookupAtom("procedure"); TermProcedure = MkAtomTerm(AtomProcedure); - AtomProfile = Yap_FullLookupAtom("$profile"); TermProfile = MkAtomTerm(AtomProfile); - AtomProlog = Yap_LookupAtom("prolog"); TermProlog = MkAtomTerm(AtomProlog); - AtomProtectStack = Yap_FullLookupAtom("$protect_stack"); TermProtectStack = MkAtomTerm(AtomProtectStack); - AtomQly = Yap_LookupAtom("qly"); TermQly = MkAtomTerm(AtomQly); - AtomQuery = Yap_LookupAtom("?-"); TermQuery = MkAtomTerm(AtomQuery); - AtomQueue = Yap_LookupAtom("queue"); TermQueue = MkAtomTerm(AtomQueue); - AtomQuiet = Yap_LookupAtom("quiet"); TermQuiet = MkAtomTerm(AtomQuiet); - AtomRadix = Yap_LookupAtom("radix"); TermRadix = MkAtomTerm(AtomRadix); - AtomRandom = Yap_LookupAtom("random"); TermRandom = MkAtomTerm(AtomRandom); - AtomRange = Yap_LookupAtom("range"); TermRange = MkAtomTerm(AtomRange); - AtomRDiv = Yap_LookupAtom("rdiv"); TermRDiv = MkAtomTerm(AtomRDiv); - AtomRead = Yap_LookupAtom("read"); TermRead = MkAtomTerm(AtomRead); - AtomReadOnly = Yap_LookupAtom("read_only"); TermReadOnly = MkAtomTerm(AtomReadOnly); - AtomReadWrite = Yap_LookupAtom("read_write"); TermReadWrite = MkAtomTerm(AtomReadWrite); - AtomReadutil = Yap_LookupAtom("readutil"); TermReadutil = MkAtomTerm(AtomReadutil); - AtomReconsult = Yap_LookupAtom("reconsult"); TermReconsult = MkAtomTerm(AtomReconsult); - AtomRecordedP = Yap_FullLookupAtom("$recordep"); TermRecordedP = MkAtomTerm(AtomRecordedP); - AtomRecordedWithKey = Yap_FullLookupAtom("$recorded_with_key"); TermRecordedWithKey = MkAtomTerm(AtomRecordedWithKey); - AtomRedefineWarnings = Yap_LookupAtom("redefine_warnings"); TermRedefineWarnings = MkAtomTerm(AtomRedefineWarnings); - AtomRedoFreeze = Yap_FullLookupAtom("$redo_freeze"); TermRedoFreeze = MkAtomTerm(AtomRedoFreeze); - AtomRefoundVar = Yap_FullLookupAtom("$I_FOUND_THE_VARIABLE_AGAIN"); TermRefoundVar = MkAtomTerm(AtomRefoundVar); - AtomRelativeTo = Yap_FullLookupAtom("relative_to"); TermRelativeTo = MkAtomTerm(AtomRelativeTo); - AtomRepeat = Yap_LookupAtom("repeat"); TermRepeat = MkAtomTerm(AtomRepeat); - AtomRepeatSpace = Yap_LookupAtom("repeat "); TermRepeatSpace = MkAtomTerm(AtomRepeatSpace); - AtomReposition = Yap_LookupAtom("reposition"); TermReposition = MkAtomTerm(AtomReposition); - AtomRepresentationError = Yap_LookupAtom("representation_error"); TermRepresentationError = MkAtomTerm(AtomRepresentationError); - AtomReset = Yap_LookupAtom("reset"); TermReset = MkAtomTerm(AtomReset); - AtomResize = Yap_LookupAtom("resize"); TermResize = MkAtomTerm(AtomResize); - AtomResourceError = Yap_LookupAtom("resource_error"); TermResourceError = MkAtomTerm(AtomResourceError); - AtomRestoreRegs = Yap_FullLookupAtom("$restore_regs"); TermRestoreRegs = MkAtomTerm(AtomRestoreRegs); - AtomRetry = Yap_LookupAtom("retry"); TermRetry = MkAtomTerm(AtomRetry); - AtomRetryCounter = Yap_LookupAtom("retry_counter"); TermRetryCounter = MkAtomTerm(AtomRetryCounter); - AtomRTree = Yap_LookupAtom("rtree"); TermRTree = MkAtomTerm(AtomRTree); - AtomSafe = Yap_FullLookupAtom("$safe"); TermSafe = MkAtomTerm(AtomSafe); - AtomSafeCallCleanup = Yap_FullLookupAtom("$safe_call_cleanup"); TermSafeCallCleanup = MkAtomTerm(AtomSafeCallCleanup); - AtomSame = Yap_LookupAtom("=="); TermSame = MkAtomTerm(AtomSame); - AtomSemic = Yap_LookupAtom(";"); TermSemic = MkAtomTerm(AtomSemic); - AtomShiftCountOverflow = Yap_LookupAtom("shift_count_overflow"); TermShiftCountOverflow = MkAtomTerm(AtomShiftCountOverflow); - AtomSigAlarm = Yap_LookupAtom("sig_alarm"); TermSigAlarm = MkAtomTerm(AtomSigAlarm); - AtomSigBreak = Yap_LookupAtom("sig_break"); TermSigBreak = MkAtomTerm(AtomSigBreak); - AtomSigCreep = Yap_LookupAtom("sig_creep"); TermSigCreep = MkAtomTerm(AtomSigCreep); - AtomSigDebug = Yap_LookupAtom("sig_debug"); TermSigDebug = MkAtomTerm(AtomSigDebug); - AtomSigDelayCreep = Yap_LookupAtom("sig_delay_creep"); TermSigDelayCreep = MkAtomTerm(AtomSigDelayCreep); - AtomSigFPE = Yap_LookupAtom("sig_fpe"); TermSigFPE = MkAtomTerm(AtomSigFPE); - AtomSigHup = Yap_LookupAtom("sig_hup"); TermSigHup = MkAtomTerm(AtomSigHup); - AtomSigInt = Yap_LookupAtom("sig_int"); TermSigInt = MkAtomTerm(AtomSigInt); - AtomSigIti = Yap_LookupAtom("sig_iti"); TermSigIti = MkAtomTerm(AtomSigIti); - AtomSigPending = Yap_FullLookupAtom("$sig_pending"); TermSigPending = MkAtomTerm(AtomSigPending); - AtomSigPipe = Yap_LookupAtom("sig_pipe"); TermSigPipe = MkAtomTerm(AtomSigPipe); - AtomSigStackDump = Yap_LookupAtom("sig_stack_dump"); TermSigStackDump = MkAtomTerm(AtomSigStackDump); - AtomSigStatistics = Yap_LookupAtom("sig_statistics"); TermSigStatistics = MkAtomTerm(AtomSigStatistics); - AtomSigTrace = Yap_LookupAtom("sig_trace"); TermSigTrace = MkAtomTerm(AtomSigTrace); - AtomSigUsr1 = Yap_LookupAtom("sig_usr1"); TermSigUsr1 = MkAtomTerm(AtomSigUsr1); - AtomSigUsr2 = Yap_LookupAtom("sig_usr2"); TermSigUsr2 = MkAtomTerm(AtomSigUsr2); - AtomSigVTAlarm = Yap_LookupAtom("sig_vtalarm"); TermSigVTAlarm = MkAtomTerm(AtomSigVTAlarm); - AtomSigWakeUp = Yap_LookupAtom("sig_wake_up"); TermSigWakeUp = MkAtomTerm(AtomSigWakeUp); - AtomSilent = Yap_LookupAtom("Silent"); TermSilent = MkAtomTerm(AtomSilent); - AtomSingle = Yap_LookupAtom("single"); TermSingle = MkAtomTerm(AtomSingle); - AtomSingleVarWarnings = Yap_LookupAtom("single_var_warnings"); TermSingleVarWarnings = MkAtomTerm(AtomSingleVarWarnings); - AtomSingleton = Yap_LookupAtom("singleton"); TermSingleton = MkAtomTerm(AtomSingleton); - AtomSlash = Yap_LookupAtom("/"); TermSlash = MkAtomTerm(AtomSlash); - AtomSocket = Yap_LookupAtom("socket"); TermSocket = MkAtomTerm(AtomSocket); - AtomSolutions = Yap_LookupAtom("solutions"); TermSolutions = MkAtomTerm(AtomSolutions); - AtomSource = Yap_LookupAtom("source"); TermSource = MkAtomTerm(AtomSource); - AtomSourceSink = Yap_LookupAtom("source_sink"); TermSourceSink = MkAtomTerm(AtomSourceSink); - AtomSpy = Yap_FullLookupAtom("$spy"); TermSpy = MkAtomTerm(AtomSpy); - AtomStack = Yap_LookupAtom("stack"); TermStack = MkAtomTerm(AtomStack); - AtomStackFree = Yap_LookupAtom("stackfree"); TermStackFree = MkAtomTerm(AtomStackFree); - AtomStartupSavedState = Yap_FullLookupAtom("$startup_saved_state"); TermStartupSavedState = MkAtomTerm(AtomStartupSavedState); - AtomStaticClause = Yap_FullLookupAtom("$static_clause"); TermStaticClause = MkAtomTerm(AtomStaticClause); - AtomStaticProcedure = Yap_LookupAtom("static_procedure"); TermStaticProcedure = MkAtomTerm(AtomStaticProcedure); - AtomStream = Yap_FullLookupAtom("$stream"); TermStream = MkAtomTerm(AtomStream); - AtomSWIStream = Yap_FullLookupAtom(""); TermSWIStream = MkAtomTerm(AtomSWIStream); - AtomVStream = Yap_LookupAtom("stream"); TermVStream = MkAtomTerm(AtomVStream); - AtomStreams = Yap_LookupAtom("streams"); TermStreams = MkAtomTerm(AtomStreams); - AtomStreamOrAlias = Yap_LookupAtom("stream_or_alias"); TermStreamOrAlias = MkAtomTerm(AtomStreamOrAlias); - AtomStreamPos = Yap_FullLookupAtom("$stream_position"); TermStreamPos = MkAtomTerm(AtomStreamPos); - AtomStreamPosition = Yap_LookupAtom("stream_position"); TermStreamPosition = MkAtomTerm(AtomStreamPosition); - AtomString = Yap_LookupAtom("string"); TermString = MkAtomTerm(AtomString); - AtomStyleCheck = Yap_LookupAtom("style_check"); TermStyleCheck = MkAtomTerm(AtomStyleCheck); - AtomSTRING = Yap_FullLookupAtom("String"); TermSTRING = MkAtomTerm(AtomSTRING); - AtomSwi = Yap_LookupAtom("swi"); TermSwi = MkAtomTerm(AtomSwi); - AtomSymbolChar = Yap_LookupAtom("symbol_char"); TermSymbolChar = MkAtomTerm(AtomSymbolChar); - AtomSyntaxError = Yap_LookupAtom("syntax_error"); TermSyntaxError = MkAtomTerm(AtomSyntaxError); - AtomSyntaxErrors = Yap_LookupAtom("syntax_errors"); TermSyntaxErrors = MkAtomTerm(AtomSyntaxErrors); - AtomSyntaxErrorHandler = Yap_LookupAtom("syntax_error_handler"); TermSyntaxErrorHandler = MkAtomTerm(AtomSyntaxErrorHandler); - AtomSystem = Yap_LookupAtom("system"); TermSystem = MkAtomTerm(AtomSystem); - AtomSystemError = Yap_LookupAtom("SYSTEM_ERROR_INTERNAL"); TermSystemError = MkAtomTerm(AtomSystemError); - AtomSystemLibraryDir = Yap_LookupAtom("system_library_directory"); TermSystemLibraryDir = MkAtomTerm(AtomSystemLibraryDir); - AtomT = Yap_LookupAtom("t"); TermT = MkAtomTerm(AtomT); - AtomTerm = Yap_LookupAtom("term"); TermTerm = MkAtomTerm(AtomTerm); - AtomTermExpansion = Yap_LookupAtom("term_expansion"); TermTermExpansion = MkAtomTerm(AtomTermExpansion); - AtomTerms = Yap_LookupAtom("terms"); TermTerms = MkAtomTerm(AtomTerms); - AtomText = Yap_LookupAtom("text"); TermText = MkAtomTerm(AtomText); - AtomTextStream = Yap_LookupAtom("text_stream"); TermTextStream = MkAtomTerm(AtomTextStream); - AtomThread = Yap_LookupAtom("thread"); TermThread = MkAtomTerm(AtomThread); - AtomThreads = Yap_LookupAtom("threads"); TermThreads = MkAtomTerm(AtomThreads); - AtomThrow = Yap_LookupAtom("throw"); TermThrow = MkAtomTerm(AtomThrow); - AtomTimeOutSpec = Yap_LookupAtom("time_out_spec"); TermTimeOutSpec = MkAtomTerm(AtomTimeOutSpec); - AtomTimeoutError = Yap_LookupAtom("timeout_error"); TermTimeoutError = MkAtomTerm(AtomTimeoutError); - AtomTopLevelGoal = Yap_FullLookupAtom("$top_level_goal"); TermTopLevelGoal = MkAtomTerm(AtomTopLevelGoal); - AtomTopThreadGoal = Yap_FullLookupAtom("$top_thread_goal"); TermTopThreadGoal = MkAtomTerm(AtomTopThreadGoal); - AtomTraceMetaCall = Yap_FullLookupAtom("$trace_meta_call"); TermTraceMetaCall = MkAtomTerm(AtomTraceMetaCall); - AtomTrail = Yap_LookupAtom("trail"); - AtomTrue = Yap_LookupAtom("true"); TermTrue = MkAtomTerm(AtomTrue); - AtomTty = Yap_LookupAtom("tty"); TermTty = MkAtomTerm(AtomTty); - AtomTtys = Yap_LookupAtom("ttys"); TermTtys = MkAtomTerm(AtomTtys); - AtomTuple = Yap_LookupAtom("tuple"); TermTuple = MkAtomTerm(AtomTuple); - AtomTxt = Yap_LookupAtom("txt"); TermTxt = MkAtomTerm(AtomTxt); - AtomTypeError = Yap_LookupAtom("type_error"); TermTypeError = MkAtomTerm(AtomTypeError); - AtomUndefined = Yap_LookupAtom("undefined"); TermUndefined = MkAtomTerm(AtomUndefined); - AtomUndefp = Yap_FullLookupAtom("$undefp"); TermUndefp = MkAtomTerm(AtomUndefp); - AtomUndefp0 = Yap_FullLookupAtom("$undefp0"); TermUndefp0 = MkAtomTerm(AtomUndefp0); - AtomUnderflow = Yap_LookupAtom("underflow"); TermUnderflow = MkAtomTerm(AtomUnderflow); - AtomUnificationStack = Yap_LookupAtom("unification_stack"); TermUnificationStack = MkAtomTerm(AtomUnificationStack); - AtomUnique = Yap_LookupAtom("unique"); TermUnique = MkAtomTerm(AtomUnique); - AtomUnsignedByte = Yap_LookupAtom("unsigned_byte"); TermUnsignedByte = MkAtomTerm(AtomUnsignedByte); - AtomUnsignedChar = Yap_LookupAtom("unsigned_char"); TermUnsignedChar = MkAtomTerm(AtomUnsignedChar); - AtomUser = Yap_LookupAtom("user"); TermUser = MkAtomTerm(AtomUser); - AtomUserErr = Yap_LookupAtom("user_error"); TermUserErr = MkAtomTerm(AtomUserErr); - AtomUserIn = Yap_LookupAtom("user_input"); TermUserIn = MkAtomTerm(AtomUserIn); - AtomUserOut = Yap_LookupAtom("user_output"); TermUserOut = MkAtomTerm(AtomUserOut); - AtomDollarVar = Yap_LookupAtom("$VAR"); TermDollarVar = MkAtomTerm(AtomDollarVar); - AtomVBar = Yap_LookupAtom("|"); TermVBar = MkAtomTerm(AtomVBar); - AtomVarBranches = Yap_LookupAtom("var_branches"); TermVarBranches = MkAtomTerm(AtomVarBranches); - AtomVariableNames = Yap_LookupAtom("variable_names"); TermVariableNames = MkAtomTerm(AtomVariableNames); - AtomHiddenVar = Yap_FullLookupAtom("$V"); TermHiddenVar = MkAtomTerm(AtomHiddenVar); - AtomVariable = Yap_LookupAtom("variable"); TermVariable = MkAtomTerm(AtomVariable); - AtomVerbose = Yap_LookupAtom("verbose"); TermVerbose = MkAtomTerm(AtomVerbose); - AtomVerboseFileSearch = Yap_LookupAtom("verbose_file_search"); TermVerboseFileSearch = MkAtomTerm(AtomVerboseFileSearch); - AtomVersionNumber = Yap_FullLookupAtom("$version_name"); TermVersionNumber = MkAtomTerm(AtomVersionNumber); - AtomVeryVerbose = Yap_LookupAtom("very_verbose"); TermVeryVerbose = MkAtomTerm(AtomVeryVerbose); - AtomWakeUpGoal = Yap_FullLookupAtom("$wake_up_goal"); TermWakeUpGoal = MkAtomTerm(AtomWakeUpGoal); - AtomWarning = Yap_LookupAtom("warning"); TermWarning = MkAtomTerm(AtomWarning); - AtomWhen = Yap_FullLookupAtom("$when"); TermWhen = MkAtomTerm(AtomWhen); - AtomWrite = Yap_LookupAtom("write"); TermWrite = MkAtomTerm(AtomWrite); - AtomWriteTerm = Yap_LookupAtom("write_term"); TermWriteTerm = MkAtomTerm(AtomWriteTerm); - AtomXml = Yap_LookupAtom("xml"); TermXml = MkAtomTerm(AtomXml); - AtomYapHacks = Yap_LookupAtom("yap_hacks"); TermYapHacks = MkAtomTerm(AtomYapHacks); - AtomZeroDivisor = Yap_LookupAtom("zero_divisor"); TermZeroDivisor = MkAtomTerm(AtomZeroDivisor); - FunctorAfInet = Yap_MkFunctor(AtomAfInet,2); - FunctorAfLocal = Yap_MkFunctor(AtomAfLocal,1); - FunctorAfUnix = Yap_MkFunctor(AtomAfUnix,1); - FunctorAltNot = Yap_MkFunctor(AtomAltNot,1); - FunctorArg = Yap_MkFunctor(AtomArg,3); - FunctorArrayEntry = Yap_MkFunctor(AtomArrayAccess,3); - FunctorArrow = Yap_MkFunctor(AtomArrow,2); - FunctorDoubleArrow = Yap_MkFunctor(AtomDoubleArrow,2); - FunctorAssert1 = Yap_MkFunctor(AtomAssert,1); - FunctorAssert = Yap_MkFunctor(AtomAssert,2); - FunctorAtFoundOne = Yap_MkFunctor(AtomFoundVar,2); - FunctorAtom = Yap_MkFunctor(AtomAtom,1); - FunctorAtt1 = Yap_MkFunctor(AtomAtt1,3); - FunctorAttGoal = Yap_MkFunctor(AtomAttDo,2); - FunctorBraces = Yap_MkFunctor(AtomBraces,1); - FunctorCall = Yap_MkFunctor(AtomCall,1); - FunctorCatch = Yap_MkFunctor(AtomCatch,3); - FunctorChangeModule = Yap_MkFunctor(AtomChangeModule,1); - FunctorChars = Yap_MkFunctor(AtomChars,2); - FunctorChars1 = Yap_MkFunctor(AtomChars,1); - FunctorCleanCall = Yap_MkFunctor(AtomCleanCall,2); - FunctorClist = Yap_MkFunctor(AtomWhen,4); - FunctorCodes = Yap_MkFunctor(AtomCodes,2); - FunctorCodes1 = Yap_MkFunctor(AtomCodes,1); - FunctorColon = Yap_MkFunctor(AtomColon,2); - FunctorComma = Yap_MkFunctor(AtomComma,2); - FunctorCommentHook = Yap_MkFunctor(AtomCommentHook,3); - FunctorContext2 = Yap_MkFunctor(AtomContext,2); - FunctorConsistencyError = Yap_MkFunctor(AtomConsistencyError,1); - FunctorCreep = Yap_MkFunctor(AtomCreep,1); - FunctorCsult = Yap_MkFunctor(AtomCsult,2); - FunctorCurrentModule = Yap_MkFunctor(AtomCurrentModule,1); - FunctorCutBy = Yap_MkFunctor(AtomCutBy,1); - FunctorDBREF = Yap_MkFunctor(AtomDBREF,1); - FunctorDiff = Yap_MkFunctor(AtomDiff,2); - FunctorDoLogUpdClause = Yap_MkFunctor(AtomDoLogUpdClause,6); - FunctorDoLogUpdClause0 = Yap_MkFunctor(AtomDoLogUpdClause0,6); - FunctorDoLogUpdClauseErase = Yap_MkFunctor(AtomDoLogUpdClauseErase,6); - FunctorDoStaticClause = Yap_MkFunctor(AtomDoStaticClause,5); - FunctorDollar = Yap_MkFunctor(AtomDollar,1); - FunctorDollarVar = Yap_MkFunctor(AtomDollarVar,1); - FunctorDomainError = Yap_MkFunctor(AtomDomainError,2); - FunctorDot = Yap_MkFunctor(AtomDot,2); - FunctorDot10 = Yap_MkFunctor(AtomDot,10); - FunctorDot11 = Yap_MkFunctor(AtomDot,11); - FunctorDot12 = Yap_MkFunctor(AtomDot,12); - FunctorDot2 = Yap_MkFunctor(AtomDot,2); - FunctorDot3 = Yap_MkFunctor(AtomDot,3); - FunctorDot4 = Yap_MkFunctor(AtomDot,4); - FunctorDot5 = Yap_MkFunctor(AtomDot,5); - FunctorDot6 = Yap_MkFunctor(AtomDot,6); - FunctorDot7 = Yap_MkFunctor(AtomDot,7); - FunctorDot8 = Yap_MkFunctor(AtomDot,8); - FunctorDot9 = Yap_MkFunctor(AtomDot,9); - FunctorDoubleArrow = Yap_MkFunctor(AtomDoubleArrow,2); - FunctorDoubleSlash = Yap_MkFunctor(AtomDoubleSlash,2); - FunctorEmptySquareBrackets = Yap_MkFunctor(AtomEmptySquareBrackets,2); - FunctorEq = Yap_MkFunctor(AtomEq,2); - FunctorError = Yap_MkFunctor(AtomError,2); - FunctorEvaluationError = Yap_MkFunctor(AtomEvaluationError,1); - FunctorException = Yap_MkFunctor(AtomException,1); - FunctorExecute2InMod = Yap_MkFunctor(AtomExecuteWoMod,2); - FunctorExecuteInMod = Yap_MkFunctor(AtomExecuteInMod,2); - FunctorExecuteWithin = Yap_MkFunctor(AtomExecuteWithin,1); - FunctorExistenceError = Yap_MkFunctor(AtomExistenceError,2); - FunctorExoClause = Yap_MkFunctor(AtomExoClause,2); - FunctorFunctor = Yap_MkFunctor(AtomFunctor,3); - FunctorGAtom = Yap_MkFunctor(AtomAtom,1); - FunctorGAtomic = Yap_MkFunctor(AtomAtomic,1); - FunctorGCompound = Yap_MkFunctor(AtomCompound,1); - FunctorGFloat = Yap_MkFunctor(AtomFloat,1); - FunctorGFormatAt = Yap_MkFunctor(AtomFormatAt,2); - FunctorGInteger = Yap_MkFunctor(AtomInteger,1); - FunctorGNumber = Yap_MkFunctor(AtomNumber,1); - FunctorGPrimitive = Yap_MkFunctor(AtomPrimitive,1); - FunctorGVar = Yap_MkFunctor(AtomGVar,1); - FunctorGeneratePredInfo = Yap_MkFunctor(AtomGeneratePredInfo,4); - FunctorGoalExpansion2 = Yap_MkFunctor(AtomGoalExpansion,2); - FunctorGoalExpansion = Yap_MkFunctor(AtomGoalExpansion,3); - FunctorHandleThrow = Yap_MkFunctor(AtomHandleThrow,3); - FunctorHat = Yap_MkFunctor(AtomHat,2); - FunctorI = Yap_MkFunctor(AtomI,2); - FunctorId = Yap_MkFunctor(AtomId,1); - FunctorInfo1 = Yap_MkFunctor(AtomInfo,1); - FunctorInfo2 = Yap_MkFunctor(AtomInfo,2); - FunctorInfo3 = Yap_MkFunctor(AtomInfo,3); - FunctorInfo4 = Yap_MkFunctor(AtomInfo,4); - FunctorIs = Yap_MkFunctor(AtomIs,2); - FunctorJ = Yap_MkFunctor(AtomJ,2); - FunctorLastExecuteWithin = Yap_MkFunctor(AtomLastExecuteWithin,1); - FunctorList = Yap_MkFunctor(AtomDot,2); - FunctorLOOP = Yap_MkFunctor(AtomLOOP,1); - FunctorMegaClause = Yap_MkFunctor(AtomMegaClause,2); - FunctorMetaCall = Yap_MkFunctor(AtomMetaCall,4); - FunctorMinus = Yap_MkFunctor(AtomMinus,2); - FunctorModule = Yap_MkFunctor(AtomColon,2); - FunctorMultiFileClause = Yap_MkFunctor(AtomMfClause,5); - FunctorMutable = Yap_MkFunctor(AtomMutableVariable,(sizeof(timed_var)/sizeof(CELL))); - FunctorMutex = Yap_MkFunctor(AtomMutex,2); - FunctorNotImplemented = Yap_MkFunctor(AtomNotImplemented,2); - FunctorNBQueue = Yap_MkFunctor(AtomQueue,4); - FunctorNot = Yap_MkFunctor(AtomNot,1); - FunctorObj = Yap_MkFunctor(AtomObj,1); - FunctorOr = Yap_MkFunctor(AtomSemic,2); - FunctorPermissionError = Yap_MkFunctor(AtomPermissionError,3); - FunctorPlus = Yap_MkFunctor(AtomPlus,2); - FunctorPortray = Yap_MkFunctor(AtomPortray,1); - FunctorPrintMessage = Yap_MkFunctor(AtomPrintMessage,2); - FunctorProcedure = Yap_MkFunctor(AtomProcedure,5); - FunctorPrologConstraint = Yap_MkFunctor(AtomProlog,2); - FunctorProtectStack = Yap_MkFunctor(AtomProtectStack,4); - FunctorQuery = Yap_MkFunctor(AtomQuery,1); - FunctorRecordedWithKey = Yap_MkFunctor(AtomRecordedWithKey,6); - FunctorRDiv = Yap_MkFunctor(AtomRDiv,2); - FunctorRedoFreeze = Yap_MkFunctor(AtomRedoFreeze,3); - FunctorRepresentationError = Yap_MkFunctor(AtomRepresentationError,1); - FunctorResourceError = Yap_MkFunctor(AtomResourceError,1); - FunctorRestoreRegs = Yap_MkFunctor(AtomRestoreRegs,2); - FunctorRestoreRegs1 = Yap_MkFunctor(AtomRestoreRegs,1); - FunctorSafe = Yap_MkFunctor(AtomSafe,1); - FunctorSafeCallCleanup = Yap_MkFunctor(AtomSafeCallCleanup,4); - FunctorSame = Yap_MkFunctor(AtomSame,2); - FunctorSlash = Yap_MkFunctor(AtomSlash,2); - FunctorStaticClause = Yap_MkFunctor(AtomStaticClause,2); - FunctorStream = Yap_MkFunctor(AtomStream,1); - FunctorStreamEOS = Yap_MkFunctor(AtomEndOfStream,1); - FunctorStreamPos = Yap_MkFunctor(AtomStreamPos,4); - FunctorString1 = Yap_MkFunctor(AtomString,1); - FunctorStyleCheck = Yap_MkFunctor(AtomStyleCheck,4); - FunctorSyntaxError = Yap_MkFunctor(AtomSyntaxError,4); - FunctorShortSyntaxError = Yap_MkFunctor(AtomSyntaxError,1); - FunctorTermExpansion = Yap_MkFunctor(AtomTermExpansion,2); - FunctorThreadRun = Yap_MkFunctor(AtomTopThreadGoal,2); - FunctorThrow = Yap_MkFunctor(AtomThrow,1); - FunctorTimeoutError = Yap_MkFunctor(AtomTimeoutError,2); - FunctorTraceMetaCall = Yap_MkFunctor(AtomTraceMetaCall,3); - FunctorTypeError = Yap_MkFunctor(AtomTypeError,2); - FunctorUMinus = Yap_MkFunctor(AtomMinus,1); - FunctorUPlus = Yap_MkFunctor(AtomPlus,1); - FunctorVBar = Yap_MkFunctor(AtomVBar,2); - FunctorWriteTerm = Yap_MkFunctor(AtomWriteTerm,2); - FunctorHiddenVar = Yap_MkFunctor(AtomHiddenVar,1); + + /* This file, iatoms.h, was generated automatically by "yap -L misc/buildatoms" + {lease do not update, update misc/ATOMS instead */ + + Atom3Dots = Yap_LookupAtom("..."); + AtomAbol = Yap_FullLookupAtom("$abol"); TermAbol = MkAtomTerm(AtomAbol); + AtomAccess = Yap_LookupAtom("access"); TermAccess = MkAtomTerm(AtomAccess); + AtomAfInet = Yap_LookupAtom("AF_INET"); TermAfInet = MkAtomTerm(AtomAfInet); + AtomAfLocal = Yap_LookupAtom("AF_LOCAL"); TermAfLocal = MkAtomTerm(AtomAfLocal); + AtomAfUnix = Yap_LookupAtom("AF_UNIX"); TermAfUnix = MkAtomTerm(AtomAfUnix); + AtomAlarm = Yap_FullLookupAtom("$alarm"); TermAlarm = MkAtomTerm(AtomAlarm); + AtomAlias = Yap_LookupAtom("alias"); TermAlias = MkAtomTerm(AtomAlias); + AtomAll = Yap_LookupAtom("all"); TermAll = MkAtomTerm(AtomAll); + AtomAltNot = Yap_LookupAtom("not"); TermAltNot = MkAtomTerm(AtomAltNot); + AtomAnswer = Yap_LookupAtom("answer"); TermAnswer = MkAtomTerm(AtomAnswer); + AtomAny = Yap_LookupAtom("any"); TermAny = MkAtomTerm(AtomAny); + AtomAppend = Yap_LookupAtom("append"); TermAppend = MkAtomTerm(AtomAppend); + AtomArg = Yap_LookupAtom("arg"); TermArg = MkAtomTerm(AtomArg); + AtomArray = Yap_FullLookupAtom("$array"); TermArray = MkAtomTerm(AtomArray); + AtomArrayAccess = Yap_FullLookupAtom("$array_arg"); TermArrayAccess = MkAtomTerm(AtomArrayAccess); + AtomArrayOverflow = Yap_LookupAtom("array_overflow"); TermArrayOverflow = MkAtomTerm(AtomArrayOverflow); + AtomArrayType = Yap_LookupAtom("array_type"); TermArrayType = MkAtomTerm(AtomArrayType); + AtomArrow = Yap_LookupAtom("->"); TermArrow = MkAtomTerm(AtomArrow); + AtomAttributedModule = Yap_LookupAtom("attributes_module"); TermAttributedModule = MkAtomTerm(AtomAttributedModule); + AtomDoubleArrow = Yap_LookupAtom("-->"); TermDoubleArrow = MkAtomTerm(AtomDoubleArrow); + AtomAssert = Yap_LookupAtom(":-"); TermAssert = MkAtomTerm(AtomAssert); + AtomBeginBracket = Yap_LookupAtom("("); TermBeginBracket = MkAtomTerm(AtomBeginBracket); + AtomEndBracket = Yap_LookupAtom(")"); TermEndBracket = MkAtomTerm(AtomEndBracket); + AtomBeginSquareBracket = Yap_LookupAtom("["); TermBeginSquareBracket = MkAtomTerm(AtomBeginSquareBracket); + AtomEndSquareBracket = Yap_LookupAtom("]"); TermEndSquareBracket = MkAtomTerm(AtomEndSquareBracket); + AtomBeginCurlyBracket = Yap_LookupAtom("{"); TermBeginCurlyBracket = MkAtomTerm(AtomBeginCurlyBracket); + AtomEndCurlyBracket = Yap_LookupAtom("}"); TermEndCurlyBracket = MkAtomTerm(AtomEndCurlyBracket); + AtomEmptyBrackets = Yap_LookupAtom("()"); TermEmptyBrackets = MkAtomTerm(AtomEmptyBrackets); + AtomEmptySquareBrackets = Yap_LookupAtom("[]"); TermEmptySquareBrackets = MkAtomTerm(AtomEmptySquareBrackets); + AtomAsserta = Yap_LookupAtom("asserta"); TermAsserta = MkAtomTerm(AtomAsserta); + AtomAssertaStatic = Yap_LookupAtom("asserta_static"); TermAssertaStatic = MkAtomTerm(AtomAssertaStatic); + AtomAssertz = Yap_LookupAtom("assertz"); TermAssertz = MkAtomTerm(AtomAssertz); + AtomAssertzStatic = Yap_LookupAtom("assertz_static"); TermAssertzStatic = MkAtomTerm(AtomAssertzStatic); + AtomAt = Yap_LookupAtom("at"); TermAt = MkAtomTerm(AtomAt); + AtomAtom = Yap_LookupAtom("atom"); TermAtom = MkAtomTerm(AtomAtom); + AtomAtomic = Yap_LookupAtom("atomic"); TermAtomic = MkAtomTerm(AtomAtomic); + AtomAtt = Yap_FullLookupAtom("$att"); TermAtt = MkAtomTerm(AtomAtt); + AtomAtt1 = Yap_LookupAtom("att"); TermAtt1 = MkAtomTerm(AtomAtt1); + AtomAttDo = Yap_FullLookupAtom("$att_do"); TermAttDo = MkAtomTerm(AtomAttDo); + AtomAttributes = Yap_LookupAtom("attributes"); TermAttributes = MkAtomTerm(AtomAttributes); + AtomB = Yap_FullLookupAtom("$last_choice_pt"); TermB = MkAtomTerm(AtomB); + AtomBatched = Yap_LookupAtom("batched"); TermBatched = MkAtomTerm(AtomBatched); + AtomBetween = Yap_LookupAtom("between"); TermBetween = MkAtomTerm(AtomBetween); + AtomBinary = Yap_LookupAtom("binary"); TermBinary = MkAtomTerm(AtomBinary); + AtomBigNum = Yap_LookupAtom("big_num"); TermBigNum = MkAtomTerm(AtomBigNum); + AtomBinaryStream = Yap_LookupAtom("binary_stream"); TermBinaryStream = MkAtomTerm(AtomBinaryStream); + AtomBoolean = Yap_LookupAtom("boolean"); TermBoolean = MkAtomTerm(AtomBoolean); + AtomBraces = Yap_LookupAtom("{}"); TermBraces = MkAtomTerm(AtomBraces); + AtomBreak = Yap_FullLookupAtom("$break"); TermBreak = MkAtomTerm(AtomBreak); + AtomByte = Yap_LookupAtom("byte"); TermByte = MkAtomTerm(AtomByte); + AtomCArith = Yap_FullLookupAtom("$c_arith"); TermCArith = MkAtomTerm(AtomCArith); + AtomCall = Yap_LookupAtom("call"); TermCall = MkAtomTerm(AtomCall); + AtomCallAndRetryCounter = Yap_LookupAtom("call_and_retry_counter"); TermCallAndRetryCounter = MkAtomTerm(AtomCallAndRetryCounter); + AtomCallCounter = Yap_LookupAtom("call_counter"); TermCallCounter = MkAtomTerm(AtomCallCounter); + AtomCallable = Yap_LookupAtom("callable"); TermCallable = MkAtomTerm(AtomCallable); + AtomCatch = Yap_FullLookupAtom("$catch"); TermCatch = MkAtomTerm(AtomCatch); + AtomChangeModule = Yap_FullLookupAtom("$change_module"); TermChangeModule = MkAtomTerm(AtomChangeModule); + AtomChar = Yap_LookupAtom("char"); TermChar = MkAtomTerm(AtomChar); + AtomCharsio = Yap_LookupAtom("charsio"); TermCharsio = MkAtomTerm(AtomCharsio); + AtomCharacter = Yap_LookupAtom("character"); TermCharacter = MkAtomTerm(AtomCharacter); + AtomCharacterCode = Yap_LookupAtom("character_code"); TermCharacterCode = MkAtomTerm(AtomCharacterCode); + AtomChars = Yap_LookupAtom("chars"); TermChars = MkAtomTerm(AtomChars); + AtomCharset = Yap_LookupAtom("charset"); TermCharset = MkAtomTerm(AtomCharset); + AtomChType = Yap_FullLookupAtom("$char_type"); TermChType = MkAtomTerm(AtomChType); + AtomCleanCall = Yap_FullLookupAtom("$clean_call"); TermCleanCall = MkAtomTerm(AtomCleanCall); + AtomClose = Yap_LookupAtom("close"); TermClose = MkAtomTerm(AtomClose); + AtomColon = Yap_LookupAtom(":"); TermColon = MkAtomTerm(AtomColon); + AtomCodeSpace = Yap_LookupAtom("code_space"); TermCodeSpace = MkAtomTerm(AtomCodeSpace); + AtomCodes = Yap_LookupAtom("codes"); TermCodes = MkAtomTerm(AtomCodes); + AtomCoInductive = Yap_LookupAtom("coinductive"); TermCoInductive = MkAtomTerm(AtomCoInductive); + AtomComma = Yap_LookupAtom(","); TermComma = MkAtomTerm(AtomComma); + AtomCommentHook = Yap_LookupAtom("comment_hook"); TermCommentHook = MkAtomTerm(AtomCommentHook); + AtomCompact = Yap_LookupAtom("compact"); TermCompact = MkAtomTerm(AtomCompact); + AtomCompound = Yap_LookupAtom("compound"); TermCompound = MkAtomTerm(AtomCompound); + AtomConsistencyError = Yap_LookupAtom("consistency_error"); TermConsistencyError = MkAtomTerm(AtomConsistencyError); + AtomConsult = Yap_LookupAtom("consult"); TermConsult = MkAtomTerm(AtomConsult); + AtomConsultOnBoot = Yap_FullLookupAtom("$consult_on_boot"); TermConsultOnBoot = MkAtomTerm(AtomConsultOnBoot); + AtomContext = Yap_LookupAtom("context"); TermContext = MkAtomTerm(AtomContext); + AtomCputime = Yap_LookupAtom("cputime"); TermCputime = MkAtomTerm(AtomCputime); + AtomCreate = Yap_LookupAtom("create"); TermCreate = MkAtomTerm(AtomCreate); + AtomCreep = Yap_FullLookupAtom("$creep"); TermCreep = MkAtomTerm(AtomCreep); + AtomCryptAtoms = Yap_LookupAtom("crypt_atoms"); TermCryptAtoms = MkAtomTerm(AtomCryptAtoms); + AtomCurly = Yap_LookupAtom("{}"); TermCurly = MkAtomTerm(AtomCurly); + AtomCsult = Yap_FullLookupAtom("$csult"); TermCsult = MkAtomTerm(AtomCsult); + AtomCurrentModule = Yap_FullLookupAtom("$current_module"); TermCurrentModule = MkAtomTerm(AtomCurrentModule); + AtomCut = Yap_LookupAtom("!"); TermCut = MkAtomTerm(AtomCut); + AtomCutBy = Yap_FullLookupAtom("$cut_by"); TermCutBy = MkAtomTerm(AtomCutBy); + AtomDAbort = Yap_LookupAtom("abort"); TermDAbort = MkAtomTerm(AtomDAbort); + AtomDBLoad = Yap_FullLookupAtom("$db_load"); TermDBLoad = MkAtomTerm(AtomDBLoad); + AtomDBREF = Yap_LookupAtom("DBRef"); TermDBREF = MkAtomTerm(AtomDBREF); + AtomDBReference = Yap_LookupAtom("db_reference"); TermDBReference = MkAtomTerm(AtomDBReference); + AtomDBTerm = Yap_LookupAtom("db_term"); TermDBTerm = MkAtomTerm(AtomDBTerm); + AtomDBref = Yap_FullLookupAtom("$dbref"); TermDBref = MkAtomTerm(AtomDBref); + AtomDInteger = Yap_FullLookupAtom("$integer"); TermDInteger = MkAtomTerm(AtomDInteger); + AtomDebugMeta = Yap_FullLookupAtom("$debug_meta"); TermDebugMeta = MkAtomTerm(AtomDebugMeta); + AtomDebuggerInput = Yap_LookupAtom("debugger_input"); TermDebuggerInput = MkAtomTerm(AtomDebuggerInput); + AtomDec10 = Yap_LookupAtom("dec10"); TermDec10 = MkAtomTerm(AtomDec10); + AtomDefault = Yap_LookupAtom("default"); TermDefault = MkAtomTerm(AtomDefault); + AtomDevNull = Yap_LookupAtom("/dev/null"); TermDevNull = MkAtomTerm(AtomDevNull); + AtomDiff = Yap_LookupAtom("\\="); TermDiff = MkAtomTerm(AtomDiff); + AtomDirectory = Yap_LookupAtom("disrectorys"); TermDirectory = MkAtomTerm(AtomDirectory); + AtomDiscontiguous = Yap_LookupAtom("discontiguous"); TermDiscontiguous = MkAtomTerm(AtomDiscontiguous); + AtomDiscontiguousWarnings = Yap_LookupAtom("discontiguous_warnings"); TermDiscontiguousWarnings = MkAtomTerm(AtomDiscontiguousWarnings); + AtomDollar = Yap_FullLookupAtom("$"); TermDollar = MkAtomTerm(AtomDollar); + AtomDoLogUpdClause = Yap_FullLookupAtom("$do_log_upd_clause"); TermDoLogUpdClause = MkAtomTerm(AtomDoLogUpdClause); + AtomDoLogUpdClause0 = Yap_FullLookupAtom("$do_log_upd_clause0"); TermDoLogUpdClause0 = MkAtomTerm(AtomDoLogUpdClause0); + AtomDoLogUpdClauseErase = Yap_FullLookupAtom("$do_log_upd_clause_erase"); TermDoLogUpdClauseErase = MkAtomTerm(AtomDoLogUpdClauseErase); + AtomDollarU = Yap_FullLookupAtom("$u"); TermDollarU = MkAtomTerm(AtomDollarU); + AtomDollarUndef = Yap_FullLookupAtom("$undef"); TermDollarUndef = MkAtomTerm(AtomDollarUndef); + AtomDomainError = Yap_LookupAtom("domain_error"); TermDomainError = MkAtomTerm(AtomDomainError); + AtomDoStaticClause = Yap_FullLookupAtom("$do_static_clause"); TermDoStaticClause = MkAtomTerm(AtomDoStaticClause); + AtomDots = Yap_LookupAtom("dots"); TermDots = MkAtomTerm(AtomDots); + AtomDOUBLE = Yap_FullLookupAtom("Double"); TermDOUBLE = MkAtomTerm(AtomDOUBLE); + AtomDoubleSlash = Yap_FullLookupAtom("//"); TermDoubleSlash = MkAtomTerm(AtomDoubleSlash); + AtomE = Yap_LookupAtom("e"); TermE = MkAtomTerm(AtomE); + AtomEOFBeforeEOT = Yap_LookupAtom("end_of_file_found_before_end_of_term"); TermEOFBeforeEOT = MkAtomTerm(AtomEOFBeforeEOT); + AtomEQ = Yap_LookupAtom("="); TermEQ = MkAtomTerm(AtomEQ); + AtomEmptyAtom = Yap_LookupAtom(""); TermEmptyAtom = MkAtomTerm(AtomEmptyAtom); + AtomEncoding = Yap_LookupAtom("encoding"); TermEncoding = MkAtomTerm(AtomEncoding); + AtomEndOfStream = Yap_LookupAtom("$end_of_stream"); TermEndOfStream = MkAtomTerm(AtomEndOfStream); + AtomEof = Yap_LookupAtom("end_of_file"); TermEof = MkAtomTerm(AtomEof); + AtomEOfCode = Yap_LookupAtom("eof_code"); TermEOfCode = MkAtomTerm(AtomEOfCode); + AtomEq = Yap_LookupAtom("="); TermEq = MkAtomTerm(AtomEq); + AtomError = Yap_LookupAtom("error"); TermError = MkAtomTerm(AtomError); + AtomException = Yap_LookupAtom("exception"); TermException = MkAtomTerm(AtomException); + AtomExtensions = Yap_LookupAtom("extensions"); TermExtensions = MkAtomTerm(AtomExtensions); + AtomEvaluable = Yap_LookupAtom("evaluable"); TermEvaluable = MkAtomTerm(AtomEvaluable); + AtomEvaluationError = Yap_LookupAtom("evaluation_error"); TermEvaluationError = MkAtomTerm(AtomEvaluationError); + AtomExecutable = Yap_LookupAtom("executable"); TermExecutable = MkAtomTerm(AtomExecutable); + AtomExecute = Yap_LookupAtom("execute"); TermExecute = MkAtomTerm(AtomExecute); + AtomExecAnswers = Yap_LookupAtom("exec_answers"); TermExecAnswers = MkAtomTerm(AtomExecAnswers); + AtomExecuteInMod = Yap_FullLookupAtom("$execute_in_mod"); TermExecuteInMod = MkAtomTerm(AtomExecuteInMod); + AtomExecuteWithin = Yap_FullLookupAtom("$execute_within"); TermExecuteWithin = MkAtomTerm(AtomExecuteWithin); + AtomExecuteWoMod = Yap_FullLookupAtom("$execute_wo_mod"); TermExecuteWoMod = MkAtomTerm(AtomExecuteWoMod); + AtomExist = Yap_LookupAtom("exist"); TermExist = MkAtomTerm(AtomExist); + AtomExists = Yap_LookupAtom("exists"); TermExists = MkAtomTerm(AtomExists); + AtomExit = Yap_LookupAtom("exit"); TermExit = MkAtomTerm(AtomExit); + AtomExistenceError = Yap_LookupAtom("existence_error"); TermExistenceError = MkAtomTerm(AtomExistenceError); + AtomExoClause = Yap_FullLookupAtom("$exo_clause"); TermExoClause = MkAtomTerm(AtomExoClause); + AtomExpectedNumber = Yap_LookupAtom("expected_number_syntax"); TermExpectedNumber = MkAtomTerm(AtomExpectedNumber); + AtomExpand = Yap_LookupAtom("expand"); TermExpand = MkAtomTerm(AtomExpand); + AtomExtendFileSearchPath = Yap_FullLookupAtom("$extend_file_search_path"); TermExtendFileSearchPath = MkAtomTerm(AtomExtendFileSearchPath); + AtomExtendsions = Yap_LookupAtom("extensionh"); TermExtendsions = MkAtomTerm(AtomExtendsions); + AtomFB = Yap_LookupAtom("fb"); TermFB = MkAtomTerm(AtomFB); + AtomFail = Yap_LookupAtom("fail"); TermFail = MkAtomTerm(AtomFail); + AtomFalse = Yap_LookupAtom("false"); TermFalse = MkAtomTerm(AtomFalse); + AtomFast = Yap_FullLookupAtom("$fast"); TermFast = MkAtomTerm(AtomFast); + AtomFastFail = Yap_LookupAtom("fast_fail"); TermFastFail = MkAtomTerm(AtomFastFail); + AtomFileErrors = Yap_LookupAtom("file_errors"); TermFileErrors = MkAtomTerm(AtomFileErrors); + AtomFileerrors = Yap_LookupAtom("fileerrors"); TermFileerrors = MkAtomTerm(AtomFileerrors); + AtomFileType = Yap_LookupAtom("file_type"); TermFileType = MkAtomTerm(AtomFileType); + AtomFirst = Yap_LookupAtom("first"); TermFirst = MkAtomTerm(AtomFirst); + AtomFloat = Yap_LookupAtom("float"); TermFloat = MkAtomTerm(AtomFloat); + AtomFloatFormat = Yap_LookupAtom("\%.15g"); TermFloatFormat = MkAtomTerm(AtomFloatFormat); + AtomFloatOverflow = Yap_LookupAtom("float_overflow"); TermFloatOverflow = MkAtomTerm(AtomFloatOverflow); + AtomFloatUnderflow = Yap_LookupAtom("float_underflow"); TermFloatUnderflow = MkAtomTerm(AtomFloatUnderflow); + AtomFormat = Yap_LookupAtom("format"); TermFormat = MkAtomTerm(AtomFormat); + AtomFormatAt = Yap_FullLookupAtom("$format@"); TermFormatAt = MkAtomTerm(AtomFormatAt); + AtomFull = Yap_LookupAtom("full"); TermFull = MkAtomTerm(AtomFull); + AtomFunctor = Yap_LookupAtom("functor"); TermFunctor = MkAtomTerm(AtomFunctor); + AtomGT = Yap_LookupAtom(">"); TermGT = MkAtomTerm(AtomGT); + AtomGVar = Yap_LookupAtom("var"); TermGVar = MkAtomTerm(AtomGVar); + AtomGc = Yap_FullLookupAtom("$gc"); TermGc = MkAtomTerm(AtomGc); + AtomGcMargin = Yap_FullLookupAtom("$gc_margin"); TermGcMargin = MkAtomTerm(AtomGcMargin); + AtomGcTrace = Yap_FullLookupAtom("$gc_trace"); TermGcTrace = MkAtomTerm(AtomGcTrace); + AtomGcVerbose = Yap_FullLookupAtom("$gc_verbose"); TermGcVerbose = MkAtomTerm(AtomGcVerbose); + AtomGcVeryVerbose = Yap_FullLookupAtom("$gc_very_verbose"); TermGcVeryVerbose = MkAtomTerm(AtomGcVeryVerbose); + AtomGeneratePredInfo = Yap_FullLookupAtom("$generate_pred_info"); TermGeneratePredInfo = MkAtomTerm(AtomGeneratePredInfo); + AtomGetwork = Yap_FullLookupAtom("$getwork"); TermGetwork = MkAtomTerm(AtomGetwork); + AtomGetworkSeq = Yap_FullLookupAtom("$getwork_seq"); TermGetworkSeq = MkAtomTerm(AtomGetworkSeq); + AtomGlob = Yap_LookupAtom("glob"); TermGlob = MkAtomTerm(AtomGlob); + AtomGlobal = Yap_LookupAtom("global"); TermGlobal = MkAtomTerm(AtomGlobal); + AtomGlobalSp = Yap_LookupAtom("global_sp"); TermGlobalSp = MkAtomTerm(AtomGlobalSp); + AtomGlobalTrie = Yap_LookupAtom("global_trie"); TermGlobalTrie = MkAtomTerm(AtomGlobalTrie); + AtomGoalExpansion = Yap_LookupAtom("goal_expansion"); TermGoalExpansion = MkAtomTerm(AtomGoalExpansion); + AtomHat = Yap_LookupAtom("^"); TermHat = MkAtomTerm(AtomHat); + AtomHERE = Yap_LookupAtom("\n <====HERE====> \n"); TermHERE = MkAtomTerm(AtomHERE); + AtomHandleThrow = Yap_FullLookupAtom("$handle_throw"); TermHandleThrow = MkAtomTerm(AtomHandleThrow); + AtomHeap = Yap_LookupAtom("heap"); TermHeap = MkAtomTerm(AtomHeap); + AtomHeapUsed = Yap_LookupAtom("heapused"); TermHeapUsed = MkAtomTerm(AtomHeapUsed); + AtomHugeInt = Yap_LookupAtom("huge_int"); TermHugeInt = MkAtomTerm(AtomHugeInt); + AtomIDB = Yap_LookupAtom("idb"); TermIDB = MkAtomTerm(AtomIDB); + AtomIOMode = Yap_LookupAtom("io_mode"); TermIOMode = MkAtomTerm(AtomIOMode); + AtomI = Yap_LookupAtom("i"); TermI = MkAtomTerm(AtomI); + AtomId = Yap_LookupAtom("id"); TermId = MkAtomTerm(AtomId); + AtomIgnore = Yap_LookupAtom("ignore"); TermIgnore = MkAtomTerm(AtomIgnore); + AtomInf = Yap_LookupAtom("inf"); TermInf = MkAtomTerm(AtomInf); + AtomInfinity = Yap_LookupAtom("infinity"); TermInfinity = MkAtomTerm(AtomInfinity); + AtomInfo = Yap_LookupAtom("info"); TermInfo = MkAtomTerm(AtomInfo); + AtomInitGoal = Yap_FullLookupAtom("$init_goal"); TermInitGoal = MkAtomTerm(AtomInitGoal); + AtomInitProlog = Yap_FullLookupAtom("$init_prolog"); TermInitProlog = MkAtomTerm(AtomInitProlog); + AtomInStackExpansion = Yap_LookupAtom("in stack expansion"); TermInStackExpansion = MkAtomTerm(AtomInStackExpansion); + AtomInput = Yap_LookupAtom("input"); TermInput = MkAtomTerm(AtomInput); + AtomInstantiationError = Yap_LookupAtom("instantiation_error"); TermInstantiationError = MkAtomTerm(AtomInstantiationError); + AtomInt = Yap_LookupAtom("int"); TermInt = MkAtomTerm(AtomInt); + AtomIntOverflow = Yap_LookupAtom("int_overflow"); TermIntOverflow = MkAtomTerm(AtomIntOverflow); + AtomInteger = Yap_LookupAtom("integer"); TermInteger = MkAtomTerm(AtomInteger); + AtomInternalCompilerError = Yap_LookupAtom("internal_compiler_error"); TermInternalCompilerError = MkAtomTerm(AtomInternalCompilerError); + AtomIs = Yap_LookupAtom("is"); TermIs = MkAtomTerm(AtomIs); + AtomJ = Yap_LookupAtom("j"); TermJ = MkAtomTerm(AtomJ); + Atoml = Yap_LookupAtom("l"); Terml = MkAtomTerm(Atoml); + AtomKey = Yap_LookupAtom("key"); TermKey = MkAtomTerm(AtomKey); + AtomLDLibraryPath = Yap_LookupAtom("LD_LIBRARY_PATH"); TermLDLibraryPath = MkAtomTerm(AtomLDLibraryPath); + AtomLONGINT = Yap_LookupAtom("LongInt"); TermLONGINT = MkAtomTerm(AtomLONGINT); + AtomLOOP = Yap_LookupAtom("_LOOP_"); TermLOOP = MkAtomTerm(AtomLOOP); + AtomLoopStream = Yap_LookupAtom("loop_stream"); TermLoopStream = MkAtomTerm(AtomLoopStream); + AtomLT = Yap_LookupAtom("<"); TermLT = MkAtomTerm(AtomLT); + AtomLastExecuteWithin = Yap_FullLookupAtom("$last_execute_within"); TermLastExecuteWithin = MkAtomTerm(AtomLastExecuteWithin); + AtomLeash = Yap_FullLookupAtom("$leash"); TermLeash = MkAtomTerm(AtomLeash); + AtomLeast = Yap_LookupAtom("least"); TermLeast = MkAtomTerm(AtomLeast); + AtomLength = Yap_FullLookupAtom("length"); TermLength = MkAtomTerm(AtomLength); + AtomList = Yap_LookupAtom("list"); TermList = MkAtomTerm(AtomList); + AtomLine = Yap_LookupAtom("line"); TermLine = MkAtomTerm(AtomLine); + AtomLive = Yap_FullLookupAtom("$live"); TermLive = MkAtomTerm(AtomLive); + AtomLoadAnswers = Yap_LookupAtom("load_answers"); TermLoadAnswers = MkAtomTerm(AtomLoadAnswers); + AtomLocal = Yap_LookupAtom("local"); TermLocal = MkAtomTerm(AtomLocal); + AtomLocalSp = Yap_LookupAtom("local_sp"); TermLocalSp = MkAtomTerm(AtomLocalSp); + AtomLocalTrie = Yap_LookupAtom("local_trie"); TermLocalTrie = MkAtomTerm(AtomLocalTrie); + AtomMax = Yap_LookupAtom("max"); TermMax = MkAtomTerm(AtomMax); + AtomMaximum = Yap_LookupAtom("maximum"); TermMaximum = MkAtomTerm(AtomMaximum); + AtomMaxArity = Yap_LookupAtom("max_arity"); TermMaxArity = MkAtomTerm(AtomMaxArity); + AtomMaxFiles = Yap_LookupAtom("max_files"); TermMaxFiles = MkAtomTerm(AtomMaxFiles); + AtomMegaClause = Yap_FullLookupAtom("$mega_clause"); TermMegaClause = MkAtomTerm(AtomMegaClause); + AtomMetaCall = Yap_FullLookupAtom("$call"); TermMetaCall = MkAtomTerm(AtomMetaCall); + AtomMfClause = Yap_FullLookupAtom("$mf_clause"); TermMfClause = MkAtomTerm(AtomMfClause); + AtomMin = Yap_LookupAtom("min"); TermMin = MkAtomTerm(AtomMin); + AtomMinimum = Yap_LookupAtom("minimum"); TermMinimum = MkAtomTerm(AtomMinimum); + AtomMinus = Yap_LookupAtom("-"); TermMinus = MkAtomTerm(AtomMinus); + AtomModify = Yap_LookupAtom("modify"); TermModify = MkAtomTerm(AtomModify); + AtomModule = Yap_LookupAtom("module"); TermModule = MkAtomTerm(AtomModule); + AtomMost = Yap_LookupAtom("most"); TermMost = MkAtomTerm(AtomMost); + AtomMulti = Yap_LookupAtom("multi"); TermMulti = MkAtomTerm(AtomMulti); + AtomMultiFile = Yap_FullLookupAtom("$mf"); TermMultiFile = MkAtomTerm(AtomMultiFile); + AtomMultiple = Yap_FullLookupAtom("multiple"); TermMultiple = MkAtomTerm(AtomMultiple); + AtomMutable = Yap_LookupAtom("mutable"); TermMutable = MkAtomTerm(AtomMutable); + AtomMutableVariable = Yap_FullLookupAtom("$mutable_variable"); TermMutableVariable = MkAtomTerm(AtomMutableVariable); + AtomMutex = Yap_LookupAtom("mutex"); TermMutex = MkAtomTerm(AtomMutex); + AtomMyddasDB = Yap_FullLookupAtom("$myddas_db"); TermMyddasDB = MkAtomTerm(AtomMyddasDB); + AtomMyddasGoal = Yap_FullLookupAtom("$myddas_goal"); TermMyddasGoal = MkAtomTerm(AtomMyddasGoal); + AtomMyddasHost = Yap_FullLookupAtom("$myddas_host"); TermMyddasHost = MkAtomTerm(AtomMyddasHost); + AtomMyddasPass = Yap_FullLookupAtom("$myddas_pass"); TermMyddasPass = MkAtomTerm(AtomMyddasPass); + AtomMyddasUser = Yap_FullLookupAtom("$myddas_user"); TermMyddasUser = MkAtomTerm(AtomMyddasUser); + AtomMyddasVersionName = Yap_FullLookupAtom("$myddas_version_name"); TermMyddasVersionName = MkAtomTerm(AtomMyddasVersionName); + AtomNan = Yap_LookupAtom("nan"); TermNan = MkAtomTerm(AtomNan); + AtomNb = Yap_LookupAtom("nb"); TermNb = MkAtomTerm(AtomNb); + AtomNbTerm = Yap_LookupAtom("nb_term"); TermNbTerm = MkAtomTerm(AtomNbTerm); + AtomNew = Yap_LookupAtom("new"); TermNew = MkAtomTerm(AtomNew); + AtomNewLine = Yap_LookupAtom("nl"); TermNewLine = MkAtomTerm(AtomNewLine); + AtomNl = Yap_LookupAtom("nl"); TermNl = MkAtomTerm(AtomNl); + AtomNoEffect = Yap_LookupAtom("no_effect"); TermNoEffect = MkAtomTerm(AtomNoEffect); + AtomNoMemory = Yap_LookupAtom("no_memory"); TermNoMemory = MkAtomTerm(AtomNoMemory); + AtomNone = Yap_LookupAtom("none"); TermNone = MkAtomTerm(AtomNone); + AtomNonEmptyList = Yap_LookupAtom("non_empty_list"); TermNonEmptyList = MkAtomTerm(AtomNonEmptyList); + AtomNot = Yap_LookupAtom("\\+"); TermNot = MkAtomTerm(AtomNot); + AtomNotImplemented = Yap_LookupAtom("not_implemented"); TermNotImplemented = MkAtomTerm(AtomNotImplemented); + AtomNotLessThanZero = Yap_LookupAtom("not_less_than_zero"); TermNotLessThanZero = MkAtomTerm(AtomNotLessThanZero); + AtomNotNewline = Yap_LookupAtom("not_newline"); TermNotNewline = MkAtomTerm(AtomNotNewline); + AtomNotZero = Yap_LookupAtom("not_zero"); TermNotZero = MkAtomTerm(AtomNotZero); + AtomNumber = Yap_LookupAtom("number"); TermNumber = MkAtomTerm(AtomNumber); + AtomObj = Yap_LookupAtom("o__bj__"); TermObj = MkAtomTerm(AtomObj); + AtomOff = Yap_LookupAtom("off"); TermOff = MkAtomTerm(AtomOff); + AtomOffline = Yap_LookupAtom("offline"); TermOffline = MkAtomTerm(AtomOffline); + AtomOn = Yap_LookupAtom("on"); TermOn = MkAtomTerm(AtomOn); + AtomOnline = Yap_LookupAtom("online"); TermOnline = MkAtomTerm(AtomOnline); + AtomOpen = Yap_LookupAtom("open"); TermOpen = MkAtomTerm(AtomOpen); + AtomOperatingSystemError = Yap_LookupAtom("operating_SYSTEM_ERROR_INTERNAL"); TermOperatingSystemError = MkAtomTerm(AtomOperatingSystemError); + AtomOperatingSystemSupport = Yap_LookupAtom("operating_system_support"); TermOperatingSystemSupport = MkAtomTerm(AtomOperatingSystemSupport); + AtomOperator = Yap_LookupAtom("operator"); TermOperator = MkAtomTerm(AtomOperator); + AtomOperatorPriority = Yap_LookupAtom("operator_priority"); TermOperatorPriority = MkAtomTerm(AtomOperatorPriority); + AtomOperatorSpecifier = Yap_LookupAtom("operator_specifier"); TermOperatorSpecifier = MkAtomTerm(AtomOperatorSpecifier); + AtomOpt = Yap_LookupAtom("opt"); TermOpt = MkAtomTerm(AtomOpt); + AtomOtherwise = Yap_LookupAtom("otherwise"); TermOtherwise = MkAtomTerm(AtomOtherwise); + AtomOutOfAttvarsError = Yap_LookupAtom("out_of_attvars_error"); TermOutOfAttvarsError = MkAtomTerm(AtomOutOfAttvarsError); + AtomOutOfAuxspaceError = Yap_LookupAtom("out_of_auxspace_error"); TermOutOfAuxspaceError = MkAtomTerm(AtomOutOfAuxspaceError); + AtomOutOfHeapError = Yap_LookupAtom("out_of_heap_error"); TermOutOfHeapError = MkAtomTerm(AtomOutOfHeapError); + AtomOutOfRange = Yap_LookupAtom("out_of_range"); TermOutOfRange = MkAtomTerm(AtomOutOfRange); + AtomOutOfStackError = Yap_LookupAtom("out_of_stack_error"); TermOutOfStackError = MkAtomTerm(AtomOutOfStackError); + AtomOutOfTrailError = Yap_LookupAtom("out_of_trail_error"); TermOutOfTrailError = MkAtomTerm(AtomOutOfTrailError); + AtomOutput = Yap_LookupAtom("output"); TermOutput = MkAtomTerm(AtomOutput); + AtomParameter = Yap_LookupAtom("parameter"); TermParameter = MkAtomTerm(AtomParameter); + AtomPrologCommonsDir = Yap_LookupAtom("prolog_commons_directory"); TermPrologCommonsDir = MkAtomTerm(AtomPrologCommonsDir); + AtomPast = Yap_LookupAtom("past"); TermPast = MkAtomTerm(AtomPast); + AtomPastEndOfStream = Yap_LookupAtom("past_end_of_stream"); TermPastEndOfStream = MkAtomTerm(AtomPastEndOfStream); + AtomPermissionError = Yap_LookupAtom("permission_error"); TermPermissionError = MkAtomTerm(AtomPermissionError); + AtomPi = Yap_LookupAtom("pi"); TermPi = MkAtomTerm(AtomPi); + AtomPipe = Yap_LookupAtom("pipe"); TermPipe = MkAtomTerm(AtomPipe); + AtomPriority = Yap_LookupAtom("priority"); TermPriority = MkAtomTerm(AtomPriority); + AtomPlus = Yap_LookupAtom("+"); TermPlus = MkAtomTerm(AtomPlus); + AtomPointer = Yap_LookupAtom("pointer"); TermPointer = MkAtomTerm(AtomPointer); + AtomPortray = Yap_FullLookupAtom("portray"); TermPortray = MkAtomTerm(AtomPortray); + AtomPredicateIndicator = Yap_LookupAtom("predicate_indicator"); TermPredicateIndicator = MkAtomTerm(AtomPredicateIndicator); + AtomPrimitive = Yap_LookupAtom("primitive"); TermPrimitive = MkAtomTerm(AtomPrimitive); + AtomPrintMessage = Yap_LookupAtom("print_message"); TermPrintMessage = MkAtomTerm(AtomPrintMessage); + AtomPrivateProcedure = Yap_LookupAtom("private_procedure"); TermPrivateProcedure = MkAtomTerm(AtomPrivateProcedure); + AtomProcedure = Yap_LookupAtom("procedure"); TermProcedure = MkAtomTerm(AtomProcedure); + AtomProfile = Yap_FullLookupAtom("$profile"); TermProfile = MkAtomTerm(AtomProfile); + AtomProlog = Yap_LookupAtom("prolog"); TermProlog = MkAtomTerm(AtomProlog); + AtomProtectStack = Yap_FullLookupAtom("$protect_stack"); TermProtectStack = MkAtomTerm(AtomProtectStack); + AtomQly = Yap_LookupAtom("qly"); TermQly = MkAtomTerm(AtomQly); + AtomQuery = Yap_LookupAtom("?-"); TermQuery = MkAtomTerm(AtomQuery); + AtomQueue = Yap_LookupAtom("queue"); TermQueue = MkAtomTerm(AtomQueue); + AtomQuiet = Yap_LookupAtom("quiet"); TermQuiet = MkAtomTerm(AtomQuiet); + AtomRadix = Yap_LookupAtom("radix"); TermRadix = MkAtomTerm(AtomRadix); + AtomRandom = Yap_LookupAtom("random"); TermRandom = MkAtomTerm(AtomRandom); + AtomRange = Yap_LookupAtom("range"); TermRange = MkAtomTerm(AtomRange); + AtomRDiv = Yap_LookupAtom("rdiv"); TermRDiv = MkAtomTerm(AtomRDiv); + AtomRead = Yap_LookupAtom("read"); TermRead = MkAtomTerm(AtomRead); + AtomReadOnly = Yap_LookupAtom("read_only"); TermReadOnly = MkAtomTerm(AtomReadOnly); + AtomReadWrite = Yap_LookupAtom("read_write"); TermReadWrite = MkAtomTerm(AtomReadWrite); + AtomReadutil = Yap_LookupAtom("readutil"); TermReadutil = MkAtomTerm(AtomReadutil); + AtomReconsult = Yap_LookupAtom("reconsult"); TermReconsult = MkAtomTerm(AtomReconsult); + AtomRecordedP = Yap_FullLookupAtom("$recordep"); TermRecordedP = MkAtomTerm(AtomRecordedP); + AtomRecordedWithKey = Yap_FullLookupAtom("$recorded_with_key"); TermRecordedWithKey = MkAtomTerm(AtomRecordedWithKey); + AtomRedefineWarnings = Yap_LookupAtom("redefine_warnings"); TermRedefineWarnings = MkAtomTerm(AtomRedefineWarnings); + AtomRedoFreeze = Yap_FullLookupAtom("$redo_freeze"); TermRedoFreeze = MkAtomTerm(AtomRedoFreeze); + AtomRefoundVar = Yap_FullLookupAtom("$I_FOUND_THE_VARIABLE_AGAIN"); TermRefoundVar = MkAtomTerm(AtomRefoundVar); + AtomRelativeTo = Yap_FullLookupAtom("relative_to"); TermRelativeTo = MkAtomTerm(AtomRelativeTo); + AtomRepeat = Yap_LookupAtom("repeat"); TermRepeat = MkAtomTerm(AtomRepeat); + AtomRepeatSpace = Yap_LookupAtom("repeat "); TermRepeatSpace = MkAtomTerm(AtomRepeatSpace); + AtomReposition = Yap_LookupAtom("reposition"); TermReposition = MkAtomTerm(AtomReposition); + AtomRepresentationError = Yap_LookupAtom("representation_error"); TermRepresentationError = MkAtomTerm(AtomRepresentationError); + AtomReset = Yap_LookupAtom("reset"); TermReset = MkAtomTerm(AtomReset); + AtomResize = Yap_LookupAtom("resize"); TermResize = MkAtomTerm(AtomResize); + AtomResourceError = Yap_LookupAtom("resource_error"); TermResourceError = MkAtomTerm(AtomResourceError); + AtomRestoreRegs = Yap_FullLookupAtom("$restore_regs"); TermRestoreRegs = MkAtomTerm(AtomRestoreRegs); + AtomRetry = Yap_LookupAtom("retry"); TermRetry = MkAtomTerm(AtomRetry); + AtomRetryCounter = Yap_LookupAtom("retry_counter"); TermRetryCounter = MkAtomTerm(AtomRetryCounter); + AtomRTree = Yap_LookupAtom("rtree"); TermRTree = MkAtomTerm(AtomRTree); + AtomSafe = Yap_FullLookupAtom("$safe"); TermSafe = MkAtomTerm(AtomSafe); + AtomSafeCallCleanup = Yap_FullLookupAtom("$safe_call_cleanup"); TermSafeCallCleanup = MkAtomTerm(AtomSafeCallCleanup); + AtomSame = Yap_LookupAtom("=="); TermSame = MkAtomTerm(AtomSame); + AtomSemic = Yap_LookupAtom(";"); TermSemic = MkAtomTerm(AtomSemic); + AtomShiftCountOverflow = Yap_LookupAtom("shift_count_overflow"); TermShiftCountOverflow = MkAtomTerm(AtomShiftCountOverflow); + AtomSigAlarm = Yap_LookupAtom("sig_alarm"); TermSigAlarm = MkAtomTerm(AtomSigAlarm); + AtomSigBreak = Yap_LookupAtom("sig_break"); TermSigBreak = MkAtomTerm(AtomSigBreak); + AtomSigCreep = Yap_LookupAtom("sig_creep"); TermSigCreep = MkAtomTerm(AtomSigCreep); + AtomSigDebug = Yap_LookupAtom("sig_debug"); TermSigDebug = MkAtomTerm(AtomSigDebug); + AtomSigDelayCreep = Yap_LookupAtom("sig_delay_creep"); TermSigDelayCreep = MkAtomTerm(AtomSigDelayCreep); + AtomSigFPE = Yap_LookupAtom("sig_fpe"); TermSigFPE = MkAtomTerm(AtomSigFPE); + AtomSigHup = Yap_LookupAtom("sig_hup"); TermSigHup = MkAtomTerm(AtomSigHup); + AtomSigInt = Yap_LookupAtom("sig_int"); TermSigInt = MkAtomTerm(AtomSigInt); + AtomSigIti = Yap_LookupAtom("sig_iti"); TermSigIti = MkAtomTerm(AtomSigIti); + AtomSigPending = Yap_FullLookupAtom("$sig_pending"); TermSigPending = MkAtomTerm(AtomSigPending); + AtomSigPipe = Yap_LookupAtom("sig_pipe"); TermSigPipe = MkAtomTerm(AtomSigPipe); + AtomSigStackDump = Yap_LookupAtom("sig_stack_dump"); TermSigStackDump = MkAtomTerm(AtomSigStackDump); + AtomSigStatistics = Yap_LookupAtom("sig_statistics"); TermSigStatistics = MkAtomTerm(AtomSigStatistics); + AtomSigTrace = Yap_LookupAtom("sig_trace"); TermSigTrace = MkAtomTerm(AtomSigTrace); + AtomSigUsr1 = Yap_LookupAtom("sig_usr1"); TermSigUsr1 = MkAtomTerm(AtomSigUsr1); + AtomSigUsr2 = Yap_LookupAtom("sig_usr2"); TermSigUsr2 = MkAtomTerm(AtomSigUsr2); + AtomSigVTAlarm = Yap_LookupAtom("sig_vtalarm"); TermSigVTAlarm = MkAtomTerm(AtomSigVTAlarm); + AtomSigWakeUp = Yap_LookupAtom("sig_wake_up"); TermSigWakeUp = MkAtomTerm(AtomSigWakeUp); + AtomSilent = Yap_LookupAtom("Silent"); TermSilent = MkAtomTerm(AtomSilent); + AtomSingle = Yap_LookupAtom("single"); TermSingle = MkAtomTerm(AtomSingle); + AtomSingleVarWarnings = Yap_LookupAtom("single_var_warnings"); TermSingleVarWarnings = MkAtomTerm(AtomSingleVarWarnings); + AtomSingleton = Yap_LookupAtom("singleton"); TermSingleton = MkAtomTerm(AtomSingleton); + AtomSlash = Yap_LookupAtom("/"); TermSlash = MkAtomTerm(AtomSlash); + AtomSocket = Yap_LookupAtom("socket"); TermSocket = MkAtomTerm(AtomSocket); + AtomSolutions = Yap_LookupAtom("solutions"); TermSolutions = MkAtomTerm(AtomSolutions); + AtomSource = Yap_LookupAtom("source"); TermSource = MkAtomTerm(AtomSource); + AtomSourceSink = Yap_LookupAtom("source_sink"); TermSourceSink = MkAtomTerm(AtomSourceSink); + AtomSpy = Yap_FullLookupAtom("$spy"); TermSpy = MkAtomTerm(AtomSpy); + AtomStack = Yap_LookupAtom("stack"); TermStack = MkAtomTerm(AtomStack); + AtomStackFree = Yap_LookupAtom("stackfree"); TermStackFree = MkAtomTerm(AtomStackFree); + AtomStartupSavedState = Yap_FullLookupAtom("$startup_saved_state"); TermStartupSavedState = MkAtomTerm(AtomStartupSavedState); + AtomStaticClause = Yap_FullLookupAtom("$static_clause"); TermStaticClause = MkAtomTerm(AtomStaticClause); + AtomStaticProcedure = Yap_LookupAtom("static_procedure"); TermStaticProcedure = MkAtomTerm(AtomStaticProcedure); + AtomStream = Yap_FullLookupAtom("$stream"); TermStream = MkAtomTerm(AtomStream); + AtomSWIStream = Yap_FullLookupAtom(""); TermSWIStream = MkAtomTerm(AtomSWIStream); + AtomVStream = Yap_LookupAtom("stream"); TermVStream = MkAtomTerm(AtomVStream); + AtomStreams = Yap_LookupAtom("streams"); TermStreams = MkAtomTerm(AtomStreams); + AtomStreamOrAlias = Yap_LookupAtom("stream_or_alias"); TermStreamOrAlias = MkAtomTerm(AtomStreamOrAlias); + AtomStreamPos = Yap_FullLookupAtom("$stream_position"); TermStreamPos = MkAtomTerm(AtomStreamPos); + AtomStreamPosition = Yap_LookupAtom("stream_position"); TermStreamPosition = MkAtomTerm(AtomStreamPosition); + AtomString = Yap_LookupAtom("string"); TermString = MkAtomTerm(AtomString); + AtomStyleCheck = Yap_LookupAtom("style_check"); TermStyleCheck = MkAtomTerm(AtomStyleCheck); + AtomSTRING = Yap_FullLookupAtom("String"); TermSTRING = MkAtomTerm(AtomSTRING); + AtomSwi = Yap_LookupAtom("swi"); TermSwi = MkAtomTerm(AtomSwi); + AtomSymbolChar = Yap_LookupAtom("symbol_char"); TermSymbolChar = MkAtomTerm(AtomSymbolChar); + AtomSyntaxError = Yap_LookupAtom("syntax_error"); TermSyntaxError = MkAtomTerm(AtomSyntaxError); + AtomSyntaxErrors = Yap_LookupAtom("syntax_errors"); TermSyntaxErrors = MkAtomTerm(AtomSyntaxErrors); + AtomSyntaxErrorHandler = Yap_LookupAtom("syntax_error_handler"); TermSyntaxErrorHandler = MkAtomTerm(AtomSyntaxErrorHandler); + AtomSystem = Yap_LookupAtom("system"); TermSystem = MkAtomTerm(AtomSystem); + AtomSystemError = Yap_LookupAtom("SYSTEM_ERROR_INTERNAL"); TermSystemError = MkAtomTerm(AtomSystemError); + AtomSystemLibraryDir = Yap_LookupAtom("system_library_directory"); TermSystemLibraryDir = MkAtomTerm(AtomSystemLibraryDir); + AtomT = Yap_LookupAtom("t"); TermT = MkAtomTerm(AtomT); + AtomTerm = Yap_LookupAtom("term"); TermTerm = MkAtomTerm(AtomTerm); + AtomTermExpansion = Yap_LookupAtom("term_expansion"); TermTermExpansion = MkAtomTerm(AtomTermExpansion); + AtomTerms = Yap_LookupAtom("terms"); TermTerms = MkAtomTerm(AtomTerms); + AtomText = Yap_LookupAtom("text"); TermText = MkAtomTerm(AtomText); + AtomTextStream = Yap_LookupAtom("text_stream"); TermTextStream = MkAtomTerm(AtomTextStream); + AtomThread = Yap_LookupAtom("thread"); TermThread = MkAtomTerm(AtomThread); + AtomThreads = Yap_LookupAtom("threads"); TermThreads = MkAtomTerm(AtomThreads); + AtomThrow = Yap_LookupAtom("throw"); TermThrow = MkAtomTerm(AtomThrow); + AtomTimeOutSpec = Yap_LookupAtom("time_out_spec"); TermTimeOutSpec = MkAtomTerm(AtomTimeOutSpec); + AtomTimeoutError = Yap_LookupAtom("timeout_error"); TermTimeoutError = MkAtomTerm(AtomTimeoutError); + AtomTopLevelGoal = Yap_FullLookupAtom("$top_level_goal"); TermTopLevelGoal = MkAtomTerm(AtomTopLevelGoal); + AtomTopThreadGoal = Yap_FullLookupAtom("$top_thread_goal"); TermTopThreadGoal = MkAtomTerm(AtomTopThreadGoal); + AtomTraceMetaCall = Yap_FullLookupAtom("$trace_meta_call"); TermTraceMetaCall = MkAtomTerm(AtomTraceMetaCall); + AtomTrail = Yap_LookupAtom("trail"); + AtomTrue = Yap_LookupAtom("true"); TermTrue = MkAtomTerm(AtomTrue); + AtomTty = Yap_LookupAtom("tty"); TermTty = MkAtomTerm(AtomTty); + AtomTtys = Yap_LookupAtom("ttys"); TermTtys = MkAtomTerm(AtomTtys); + AtomTuple = Yap_LookupAtom("tuple"); TermTuple = MkAtomTerm(AtomTuple); + AtomTxt = Yap_LookupAtom("txt"); TermTxt = MkAtomTerm(AtomTxt); + AtomTypeError = Yap_LookupAtom("type_error"); TermTypeError = MkAtomTerm(AtomTypeError); + AtomUndefined = Yap_LookupAtom("undefined"); TermUndefined = MkAtomTerm(AtomUndefined); + AtomUndefp = Yap_FullLookupAtom("$undefp"); TermUndefp = MkAtomTerm(AtomUndefp); + AtomUndefp0 = Yap_FullLookupAtom("$undefp0"); TermUndefp0 = MkAtomTerm(AtomUndefp0); + AtomUnderflow = Yap_LookupAtom("underflow"); TermUnderflow = MkAtomTerm(AtomUnderflow); + AtomUnificationStack = Yap_LookupAtom("unification_stack"); TermUnificationStack = MkAtomTerm(AtomUnificationStack); + AtomUnique = Yap_LookupAtom("unique"); TermUnique = MkAtomTerm(AtomUnique); + AtomUnsignedByte = Yap_LookupAtom("unsigned_byte"); TermUnsignedByte = MkAtomTerm(AtomUnsignedByte); + AtomUnsignedChar = Yap_LookupAtom("unsigned_char"); TermUnsignedChar = MkAtomTerm(AtomUnsignedChar); + AtomUser = Yap_LookupAtom("user"); TermUser = MkAtomTerm(AtomUser); + AtomUserErr = Yap_LookupAtom("user_error"); TermUserErr = MkAtomTerm(AtomUserErr); + AtomUserIn = Yap_LookupAtom("user_input"); TermUserIn = MkAtomTerm(AtomUserIn); + AtomUserOut = Yap_LookupAtom("user_output"); TermUserOut = MkAtomTerm(AtomUserOut); + AtomDollarVar = Yap_LookupAtom("$VAR"); TermDollarVar = MkAtomTerm(AtomDollarVar); + AtomVBar = Yap_LookupAtom("|"); TermVBar = MkAtomTerm(AtomVBar); + AtomVarBranches = Yap_LookupAtom("var_branches"); TermVarBranches = MkAtomTerm(AtomVarBranches); + AtomVariableNames = Yap_LookupAtom("variable_names"); TermVariableNames = MkAtomTerm(AtomVariableNames); + AtomHiddenVar = Yap_FullLookupAtom("$V"); TermHiddenVar = MkAtomTerm(AtomHiddenVar); + AtomVariable = Yap_LookupAtom("variable"); TermVariable = MkAtomTerm(AtomVariable); + AtomVerbose = Yap_LookupAtom("verbose"); TermVerbose = MkAtomTerm(AtomVerbose); + AtomVerboseFileSearch = Yap_LookupAtom("verbose_file_search"); TermVerboseFileSearch = MkAtomTerm(AtomVerboseFileSearch); + AtomVersionNumber = Yap_FullLookupAtom("$version_name"); TermVersionNumber = MkAtomTerm(AtomVersionNumber); + AtomVeryVerbose = Yap_LookupAtom("very_verbose"); TermVeryVerbose = MkAtomTerm(AtomVeryVerbose); + AtomWakeUpGoal = Yap_FullLookupAtom("$wake_up_goal"); TermWakeUpGoal = MkAtomTerm(AtomWakeUpGoal); + AtomWarning = Yap_LookupAtom("warning"); TermWarning = MkAtomTerm(AtomWarning); + AtomWhen = Yap_FullLookupAtom("$when"); TermWhen = MkAtomTerm(AtomWhen); + AtomWrite = Yap_LookupAtom("write"); TermWrite = MkAtomTerm(AtomWrite); + AtomWriteTerm = Yap_LookupAtom("write_term"); TermWriteTerm = MkAtomTerm(AtomWriteTerm); + AtomXml = Yap_LookupAtom("xml"); TermXml = MkAtomTerm(AtomXml); + AtomYapHacks = Yap_LookupAtom("yap_hacks"); TermYapHacks = MkAtomTerm(AtomYapHacks); + AtomZeroDivisor = Yap_LookupAtom("zero_divisor"); TermZeroDivisor = MkAtomTerm(AtomZeroDivisor); + FunctorAfInet = Yap_MkFunctor(AtomAfInet,2); + FunctorAfLocal = Yap_MkFunctor(AtomAfLocal,1); + FunctorAfUnix = Yap_MkFunctor(AtomAfUnix,1); + FunctorAltNot = Yap_MkFunctor(AtomAltNot,1); + FunctorArg = Yap_MkFunctor(AtomArg,3); + FunctorArrayEntry = Yap_MkFunctor(AtomArrayAccess,3); + FunctorArrow = Yap_MkFunctor(AtomArrow,2); + FunctorDoubleArrow = Yap_MkFunctor(AtomDoubleArrow,2); + FunctorAssert1 = Yap_MkFunctor(AtomAssert,1); + FunctorAssert = Yap_MkFunctor(AtomAssert,2); + FunctorAtFoundOne = Yap_MkFunctor(AtomFoundVar,2); + FunctorAtom = Yap_MkFunctor(AtomAtom,1); + FunctorAtt1 = Yap_MkFunctor(AtomAtt1,3); + FunctorAttGoal = Yap_MkFunctor(AtomAttDo,2); + FunctorBraces = Yap_MkFunctor(AtomBraces,1); + FunctorCall = Yap_MkFunctor(AtomCall,1); + FunctorCatch = Yap_MkFunctor(AtomCatch,3); + FunctorChangeModule = Yap_MkFunctor(AtomChangeModule,1); + FunctorChars = Yap_MkFunctor(AtomChars,2); + FunctorChars1 = Yap_MkFunctor(AtomChars,1); + FunctorCleanCall = Yap_MkFunctor(AtomCleanCall,2); + FunctorClist = Yap_MkFunctor(AtomWhen,4); + FunctorCodes = Yap_MkFunctor(AtomCodes,2); + FunctorCodes1 = Yap_MkFunctor(AtomCodes,1); + FunctorColon = Yap_MkFunctor(AtomColon,2); + FunctorComma = Yap_MkFunctor(AtomComma,2); + FunctorCommentHook = Yap_MkFunctor(AtomCommentHook,3); + FunctorContext2 = Yap_MkFunctor(AtomContext,2); + FunctorConsistencyError = Yap_MkFunctor(AtomConsistencyError,1); + FunctorCreep = Yap_MkFunctor(AtomCreep,1); + FunctorCsult = Yap_MkFunctor(AtomCsult,2); + FunctorCurrentModule = Yap_MkFunctor(AtomCurrentModule,1); + FunctorCutBy = Yap_MkFunctor(AtomCutBy,1); + FunctorDBREF = Yap_MkFunctor(AtomDBREF,1); + FunctorDiff = Yap_MkFunctor(AtomDiff,2); + FunctorDoLogUpdClause = Yap_MkFunctor(AtomDoLogUpdClause,6); + FunctorDoLogUpdClause0 = Yap_MkFunctor(AtomDoLogUpdClause0,6); + FunctorDoLogUpdClauseErase = Yap_MkFunctor(AtomDoLogUpdClauseErase,6); + FunctorDoStaticClause = Yap_MkFunctor(AtomDoStaticClause,5); + FunctorDollar = Yap_MkFunctor(AtomDollar,1); + FunctorDollarVar = Yap_MkFunctor(AtomDollarVar,1); + FunctorDomainError = Yap_MkFunctor(AtomDomainError,2); + FunctorDot = Yap_MkFunctor(AtomDot,2); + FunctorDot10 = Yap_MkFunctor(AtomDot,10); + FunctorDot11 = Yap_MkFunctor(AtomDot,11); + FunctorDot12 = Yap_MkFunctor(AtomDot,12); + FunctorDot2 = Yap_MkFunctor(AtomDot,2); + FunctorDot3 = Yap_MkFunctor(AtomDot,3); + FunctorDot4 = Yap_MkFunctor(AtomDot,4); + FunctorDot5 = Yap_MkFunctor(AtomDot,5); + FunctorDot6 = Yap_MkFunctor(AtomDot,6); + FunctorDot7 = Yap_MkFunctor(AtomDot,7); + FunctorDot8 = Yap_MkFunctor(AtomDot,8); + FunctorDot9 = Yap_MkFunctor(AtomDot,9); + FunctorDoubleArrow = Yap_MkFunctor(AtomDoubleArrow,2); + FunctorDoubleSlash = Yap_MkFunctor(AtomDoubleSlash,2); + FunctorEmptySquareBrackets = Yap_MkFunctor(AtomEmptySquareBrackets,2); + FunctorEq = Yap_MkFunctor(AtomEq,2); + FunctorError = Yap_MkFunctor(AtomError,2); + FunctorEvaluationError = Yap_MkFunctor(AtomEvaluationError,1); + FunctorException = Yap_MkFunctor(AtomException,1); + FunctorExecute2InMod = Yap_MkFunctor(AtomExecuteWoMod,2); + FunctorExecuteInMod = Yap_MkFunctor(AtomExecuteInMod,2); + FunctorExecuteWithin = Yap_MkFunctor(AtomExecuteWithin,1); + FunctorExistenceError = Yap_MkFunctor(AtomExistenceError,2); + FunctorExoClause = Yap_MkFunctor(AtomExoClause,2); + FunctorFunctor = Yap_MkFunctor(AtomFunctor,3); + FunctorGAtom = Yap_MkFunctor(AtomAtom,1); + FunctorGAtomic = Yap_MkFunctor(AtomAtomic,1); + FunctorGCompound = Yap_MkFunctor(AtomCompound,1); + FunctorGFloat = Yap_MkFunctor(AtomFloat,1); + FunctorGFormatAt = Yap_MkFunctor(AtomFormatAt,2); + FunctorGInteger = Yap_MkFunctor(AtomInteger,1); + FunctorGNumber = Yap_MkFunctor(AtomNumber,1); + FunctorGPrimitive = Yap_MkFunctor(AtomPrimitive,1); + FunctorGVar = Yap_MkFunctor(AtomGVar,1); + FunctorGeneratePredInfo = Yap_MkFunctor(AtomGeneratePredInfo,4); + FunctorGoalExpansion2 = Yap_MkFunctor(AtomGoalExpansion,2); + FunctorGoalExpansion = Yap_MkFunctor(AtomGoalExpansion,3); + FunctorHandleThrow = Yap_MkFunctor(AtomHandleThrow,3); + FunctorHat = Yap_MkFunctor(AtomHat,2); + FunctorI = Yap_MkFunctor(AtomI,2); + FunctorId = Yap_MkFunctor(AtomId,1); + FunctorInfo1 = Yap_MkFunctor(AtomInfo,1); + FunctorInfo2 = Yap_MkFunctor(AtomInfo,2); + FunctorInfo3 = Yap_MkFunctor(AtomInfo,3); + FunctorInfo4 = Yap_MkFunctor(AtomInfo,4); + FunctorIs = Yap_MkFunctor(AtomIs,2); + FunctorJ = Yap_MkFunctor(AtomJ,2); + FunctorLastExecuteWithin = Yap_MkFunctor(AtomLastExecuteWithin,1); + FunctorList = Yap_MkFunctor(AtomDot,2); + FunctorLOOP = Yap_MkFunctor(AtomLOOP,1); + FunctorMegaClause = Yap_MkFunctor(AtomMegaClause,2); + FunctorMetaCall = Yap_MkFunctor(AtomMetaCall,4); + FunctorMinus = Yap_MkFunctor(AtomMinus,2); + FunctorModule = Yap_MkFunctor(AtomColon,2); + FunctorMultiFileClause = Yap_MkFunctor(AtomMfClause,5); + FunctorMutable = Yap_MkFunctor(AtomMutableVariable,(sizeof(timed_var)/sizeof(CELL))); + FunctorMutex = Yap_MkFunctor(AtomMutex,2); + FunctorNotImplemented = Yap_MkFunctor(AtomNotImplemented,2); + FunctorNBQueue = Yap_MkFunctor(AtomQueue,4); + FunctorNot = Yap_MkFunctor(AtomNot,1); + FunctorObj = Yap_MkFunctor(AtomObj,1); + FunctorOr = Yap_MkFunctor(AtomSemic,2); + FunctorOutput = Yap_MkFunctor(AtomOutput,1); + FunctorPermissionError = Yap_MkFunctor(AtomPermissionError,3); + FunctorPlus = Yap_MkFunctor(AtomPlus,2); + FunctorPortray = Yap_MkFunctor(AtomPortray,1); + FunctorPrintMessage = Yap_MkFunctor(AtomPrintMessage,2); + FunctorProcedure = Yap_MkFunctor(AtomProcedure,5); + FunctorPriority = Yap_MkFunctor(AtomPriority,1); + FunctorPrologConstraint = Yap_MkFunctor(AtomProlog,2); + FunctorProtectStack = Yap_MkFunctor(AtomProtectStack,4); + FunctorQuery = Yap_MkFunctor(AtomQuery,1); + FunctorRecordedWithKey = Yap_MkFunctor(AtomRecordedWithKey,6); + FunctorRDiv = Yap_MkFunctor(AtomRDiv,2); + FunctorRedoFreeze = Yap_MkFunctor(AtomRedoFreeze,3); + FunctorRepresentationError = Yap_MkFunctor(AtomRepresentationError,1); + FunctorResourceError = Yap_MkFunctor(AtomResourceError,1); + FunctorRestoreRegs = Yap_MkFunctor(AtomRestoreRegs,2); + FunctorRestoreRegs1 = Yap_MkFunctor(AtomRestoreRegs,1); + FunctorSafe = Yap_MkFunctor(AtomSafe,1); + FunctorSafeCallCleanup = Yap_MkFunctor(AtomSafeCallCleanup,4); + FunctorSame = Yap_MkFunctor(AtomSame,2); + FunctorSlash = Yap_MkFunctor(AtomSlash,2); + FunctorStaticClause = Yap_MkFunctor(AtomStaticClause,2); + FunctorStream = Yap_MkFunctor(AtomStream,1); + FunctorStreamEOS = Yap_MkFunctor(AtomEndOfStream,1); + FunctorStreamPos = Yap_MkFunctor(AtomStreamPos,4); + FunctorString1 = Yap_MkFunctor(AtomString,1); + FunctorStyleCheck = Yap_MkFunctor(AtomStyleCheck,4); + FunctorSyntaxError = Yap_MkFunctor(AtomSyntaxError,4); + FunctorShortSyntaxError = Yap_MkFunctor(AtomSyntaxError,1); + FunctorTermExpansion = Yap_MkFunctor(AtomTermExpansion,2); + FunctorThreadRun = Yap_MkFunctor(AtomTopThreadGoal,2); + FunctorThrow = Yap_MkFunctor(AtomThrow,1); + FunctorTimeoutError = Yap_MkFunctor(AtomTimeoutError,2); + FunctorTraceMetaCall = Yap_MkFunctor(AtomTraceMetaCall,3); + FunctorTypeError = Yap_MkFunctor(AtomTypeError,2); + FunctorUMinus = Yap_MkFunctor(AtomMinus,1); + FunctorUPlus = Yap_MkFunctor(AtomPlus,1); + FunctorVBar = Yap_MkFunctor(AtomVBar,2); + FunctorWriteTerm = Yap_MkFunctor(AtomWriteTerm,2); + FunctorHiddenVar = Yap_MkFunctor(AtomHiddenVar,1); diff --git a/H/generated/ilocals.h b/H/generated/ilocals.h index 2ada8ba04..7da9a5e1c 100755 --- a/H/generated/ilocals.h +++ b/H/generated/ilocals.h @@ -139,7 +139,8 @@ static void InitWorker(int wid) { REMOTE_CMemFirstBlock(wid) = NULL; REMOTE_CMemFirstBlockSz(wid) = 0L; - REMOTE_nperm(wid) = 0L; + REMOTE_nperm(wid) = 0; + REMOTE_jMP(wid) = 0; REMOTE_LabelFirstArray(wid) = NULL; REMOTE_LabelFirstArraySz(wid) = 0L; diff --git a/H/generated/ratoms.h b/H/generated/ratoms.h index 1c5d5f8d8..1deb1e028 100644 --- a/H/generated/ratoms.h +++ b/H/generated/ratoms.h @@ -1,581 +1,584 @@ - - /* This file, ratoms.h, was generated automatically by "yap -L misc/buildatoms" - {lease do not update, update misc/ATOMS instead */ - - Atom3Dots = AtomAdjust(Atom3Dots); - AtomAbol = AtomAdjust(AtomAbol); TermAbol = MkAtomTerm(AtomAbol); - AtomAccess = AtomAdjust(AtomAccess); TermAccess = MkAtomTerm(AtomAccess); - AtomAfInet = AtomAdjust(AtomAfInet); TermAfInet = MkAtomTerm(AtomAfInet); - AtomAfLocal = AtomAdjust(AtomAfLocal); TermAfLocal = MkAtomTerm(AtomAfLocal); - AtomAfUnix = AtomAdjust(AtomAfUnix); TermAfUnix = MkAtomTerm(AtomAfUnix); - AtomAlarm = AtomAdjust(AtomAlarm); TermAlarm = MkAtomTerm(AtomAlarm); - AtomAlias = AtomAdjust(AtomAlias); TermAlias = MkAtomTerm(AtomAlias); - AtomAll = AtomAdjust(AtomAll); TermAll = MkAtomTerm(AtomAll); - AtomAltNot = AtomAdjust(AtomAltNot); TermAltNot = MkAtomTerm(AtomAltNot); - AtomAnswer = AtomAdjust(AtomAnswer); TermAnswer = MkAtomTerm(AtomAnswer); - AtomAny = AtomAdjust(AtomAny); TermAny = MkAtomTerm(AtomAny); - AtomAppend = AtomAdjust(AtomAppend); TermAppend = MkAtomTerm(AtomAppend); - AtomArg = AtomAdjust(AtomArg); TermArg = MkAtomTerm(AtomArg); - AtomArray = AtomAdjust(AtomArray); TermArray = MkAtomTerm(AtomArray); - AtomArrayAccess = AtomAdjust(AtomArrayAccess); TermArrayAccess = MkAtomTerm(AtomArrayAccess); - AtomArrayOverflow = AtomAdjust(AtomArrayOverflow); TermArrayOverflow = MkAtomTerm(AtomArrayOverflow); - AtomArrayType = AtomAdjust(AtomArrayType); TermArrayType = MkAtomTerm(AtomArrayType); - AtomArrow = AtomAdjust(AtomArrow); TermArrow = MkAtomTerm(AtomArrow); - AtomAttributedModule = AtomAdjust(AtomAttributedModule); TermAttributedModule = MkAtomTerm(AtomAttributedModule); - AtomDoubleArrow = AtomAdjust(AtomDoubleArrow); TermDoubleArrow = MkAtomTerm(AtomDoubleArrow); - AtomAssert = AtomAdjust(AtomAssert); TermAssert = MkAtomTerm(AtomAssert); - AtomBeginBracket = AtomAdjust(AtomBeginBracket); TermBeginBracket = MkAtomTerm(AtomBeginBracket); - AtomEndBracket = AtomAdjust(AtomEndBracket); TermEndBracket = MkAtomTerm(AtomEndBracket); - AtomBeginSquareBracket = AtomAdjust(AtomBeginSquareBracket); TermBeginSquareBracket = MkAtomTerm(AtomBeginSquareBracket); - AtomEndSquareBracket = AtomAdjust(AtomEndSquareBracket); TermEndSquareBracket = MkAtomTerm(AtomEndSquareBracket); - AtomBeginCurlyBracket = AtomAdjust(AtomBeginCurlyBracket); TermBeginCurlyBracket = MkAtomTerm(AtomBeginCurlyBracket); - AtomEndCurlyBracket = AtomAdjust(AtomEndCurlyBracket); TermEndCurlyBracket = MkAtomTerm(AtomEndCurlyBracket); - AtomEmptyBrackets = AtomAdjust(AtomEmptyBrackets); TermEmptyBrackets = MkAtomTerm(AtomEmptyBrackets); - AtomEmptySquareBrackets = AtomAdjust(AtomEmptySquareBrackets); TermEmptySquareBrackets = MkAtomTerm(AtomEmptySquareBrackets); - AtomAsserta = AtomAdjust(AtomAsserta); TermAsserta = MkAtomTerm(AtomAsserta); - AtomAssertaStatic = AtomAdjust(AtomAssertaStatic); TermAssertaStatic = MkAtomTerm(AtomAssertaStatic); - AtomAssertz = AtomAdjust(AtomAssertz); TermAssertz = MkAtomTerm(AtomAssertz); - AtomAssertzStatic = AtomAdjust(AtomAssertzStatic); TermAssertzStatic = MkAtomTerm(AtomAssertzStatic); - AtomAt = AtomAdjust(AtomAt); TermAt = MkAtomTerm(AtomAt); - AtomAtom = AtomAdjust(AtomAtom); TermAtom = MkAtomTerm(AtomAtom); - AtomAtomic = AtomAdjust(AtomAtomic); TermAtomic = MkAtomTerm(AtomAtomic); - AtomAtt = AtomAdjust(AtomAtt); TermAtt = MkAtomTerm(AtomAtt); - AtomAtt1 = AtomAdjust(AtomAtt1); TermAtt1 = MkAtomTerm(AtomAtt1); - AtomAttDo = AtomAdjust(AtomAttDo); TermAttDo = MkAtomTerm(AtomAttDo); - AtomAttributes = AtomAdjust(AtomAttributes); TermAttributes = MkAtomTerm(AtomAttributes); - AtomB = AtomAdjust(AtomB); TermB = MkAtomTerm(AtomB); - AtomBatched = AtomAdjust(AtomBatched); TermBatched = MkAtomTerm(AtomBatched); - AtomBetween = AtomAdjust(AtomBetween); TermBetween = MkAtomTerm(AtomBetween); - AtomBinary = AtomAdjust(AtomBinary); TermBinary = MkAtomTerm(AtomBinary); - AtomBigNum = AtomAdjust(AtomBigNum); TermBigNum = MkAtomTerm(AtomBigNum); - AtomBinaryStream = AtomAdjust(AtomBinaryStream); TermBinaryStream = MkAtomTerm(AtomBinaryStream); - AtomBoolean = AtomAdjust(AtomBoolean); TermBoolean = MkAtomTerm(AtomBoolean); - AtomBraces = AtomAdjust(AtomBraces); TermBraces = MkAtomTerm(AtomBraces); - AtomBreak = AtomAdjust(AtomBreak); TermBreak = MkAtomTerm(AtomBreak); - AtomByte = AtomAdjust(AtomByte); TermByte = MkAtomTerm(AtomByte); - AtomCArith = AtomAdjust(AtomCArith); TermCArith = MkAtomTerm(AtomCArith); - AtomCall = AtomAdjust(AtomCall); TermCall = MkAtomTerm(AtomCall); - AtomCallAndRetryCounter = AtomAdjust(AtomCallAndRetryCounter); TermCallAndRetryCounter = MkAtomTerm(AtomCallAndRetryCounter); - AtomCallCounter = AtomAdjust(AtomCallCounter); TermCallCounter = MkAtomTerm(AtomCallCounter); - AtomCallable = AtomAdjust(AtomCallable); TermCallable = MkAtomTerm(AtomCallable); - AtomCatch = AtomAdjust(AtomCatch); TermCatch = MkAtomTerm(AtomCatch); - AtomChangeModule = AtomAdjust(AtomChangeModule); TermChangeModule = MkAtomTerm(AtomChangeModule); - AtomChar = AtomAdjust(AtomChar); TermChar = MkAtomTerm(AtomChar); - AtomCharsio = AtomAdjust(AtomCharsio); TermCharsio = MkAtomTerm(AtomCharsio); - AtomCharacter = AtomAdjust(AtomCharacter); TermCharacter = MkAtomTerm(AtomCharacter); - AtomCharacterCode = AtomAdjust(AtomCharacterCode); TermCharacterCode = MkAtomTerm(AtomCharacterCode); - AtomChars = AtomAdjust(AtomChars); TermChars = MkAtomTerm(AtomChars); - AtomCharset = AtomAdjust(AtomCharset); TermCharset = MkAtomTerm(AtomCharset); - AtomChType = AtomAdjust(AtomChType); TermChType = MkAtomTerm(AtomChType); - AtomCleanCall = AtomAdjust(AtomCleanCall); TermCleanCall = MkAtomTerm(AtomCleanCall); - AtomClose = AtomAdjust(AtomClose); TermClose = MkAtomTerm(AtomClose); - AtomColon = AtomAdjust(AtomColon); TermColon = MkAtomTerm(AtomColon); - AtomCodeSpace = AtomAdjust(AtomCodeSpace); TermCodeSpace = MkAtomTerm(AtomCodeSpace); - AtomCodes = AtomAdjust(AtomCodes); TermCodes = MkAtomTerm(AtomCodes); - AtomCoInductive = AtomAdjust(AtomCoInductive); TermCoInductive = MkAtomTerm(AtomCoInductive); - AtomComma = AtomAdjust(AtomComma); TermComma = MkAtomTerm(AtomComma); - AtomCommentHook = AtomAdjust(AtomCommentHook); TermCommentHook = MkAtomTerm(AtomCommentHook); - AtomCompact = AtomAdjust(AtomCompact); TermCompact = MkAtomTerm(AtomCompact); - AtomCompound = AtomAdjust(AtomCompound); TermCompound = MkAtomTerm(AtomCompound); - AtomConsistencyError = AtomAdjust(AtomConsistencyError); TermConsistencyError = MkAtomTerm(AtomConsistencyError); - AtomConsult = AtomAdjust(AtomConsult); TermConsult = MkAtomTerm(AtomConsult); - AtomConsultOnBoot = AtomAdjust(AtomConsultOnBoot); TermConsultOnBoot = MkAtomTerm(AtomConsultOnBoot); - AtomContext = AtomAdjust(AtomContext); TermContext = MkAtomTerm(AtomContext); - AtomCputime = AtomAdjust(AtomCputime); TermCputime = MkAtomTerm(AtomCputime); - AtomCreate = AtomAdjust(AtomCreate); TermCreate = MkAtomTerm(AtomCreate); - AtomCreep = AtomAdjust(AtomCreep); TermCreep = MkAtomTerm(AtomCreep); - AtomCryptAtoms = AtomAdjust(AtomCryptAtoms); TermCryptAtoms = MkAtomTerm(AtomCryptAtoms); - AtomCurly = AtomAdjust(AtomCurly); TermCurly = MkAtomTerm(AtomCurly); - AtomCsult = AtomAdjust(AtomCsult); TermCsult = MkAtomTerm(AtomCsult); - AtomCurrentModule = AtomAdjust(AtomCurrentModule); TermCurrentModule = MkAtomTerm(AtomCurrentModule); - AtomCut = AtomAdjust(AtomCut); TermCut = MkAtomTerm(AtomCut); - AtomCutBy = AtomAdjust(AtomCutBy); TermCutBy = MkAtomTerm(AtomCutBy); - AtomDAbort = AtomAdjust(AtomDAbort); TermDAbort = MkAtomTerm(AtomDAbort); - AtomDBLoad = AtomAdjust(AtomDBLoad); TermDBLoad = MkAtomTerm(AtomDBLoad); - AtomDBREF = AtomAdjust(AtomDBREF); TermDBREF = MkAtomTerm(AtomDBREF); - AtomDBReference = AtomAdjust(AtomDBReference); TermDBReference = MkAtomTerm(AtomDBReference); - AtomDBTerm = AtomAdjust(AtomDBTerm); TermDBTerm = MkAtomTerm(AtomDBTerm); - AtomDBref = AtomAdjust(AtomDBref); TermDBref = MkAtomTerm(AtomDBref); - AtomDInteger = AtomAdjust(AtomDInteger); TermDInteger = MkAtomTerm(AtomDInteger); - AtomDebugMeta = AtomAdjust(AtomDebugMeta); TermDebugMeta = MkAtomTerm(AtomDebugMeta); - AtomDebuggerInput = AtomAdjust(AtomDebuggerInput); TermDebuggerInput = MkAtomTerm(AtomDebuggerInput); - AtomDec10 = AtomAdjust(AtomDec10); TermDec10 = MkAtomTerm(AtomDec10); - AtomDefault = AtomAdjust(AtomDefault); TermDefault = MkAtomTerm(AtomDefault); - AtomDevNull = AtomAdjust(AtomDevNull); TermDevNull = MkAtomTerm(AtomDevNull); - AtomDiff = AtomAdjust(AtomDiff); TermDiff = MkAtomTerm(AtomDiff); - AtomDirectory = AtomAdjust(AtomDirectory); TermDirectory = MkAtomTerm(AtomDirectory); - AtomDiscontiguous = AtomAdjust(AtomDiscontiguous); TermDiscontiguous = MkAtomTerm(AtomDiscontiguous); - AtomDiscontiguousWarnings = AtomAdjust(AtomDiscontiguousWarnings); TermDiscontiguousWarnings = MkAtomTerm(AtomDiscontiguousWarnings); - AtomDollar = AtomAdjust(AtomDollar); TermDollar = MkAtomTerm(AtomDollar); - AtomDoLogUpdClause = AtomAdjust(AtomDoLogUpdClause); TermDoLogUpdClause = MkAtomTerm(AtomDoLogUpdClause); - AtomDoLogUpdClause0 = AtomAdjust(AtomDoLogUpdClause0); TermDoLogUpdClause0 = MkAtomTerm(AtomDoLogUpdClause0); - AtomDoLogUpdClauseErase = AtomAdjust(AtomDoLogUpdClauseErase); TermDoLogUpdClauseErase = MkAtomTerm(AtomDoLogUpdClauseErase); - AtomDollarU = AtomAdjust(AtomDollarU); TermDollarU = MkAtomTerm(AtomDollarU); - AtomDollarUndef = AtomAdjust(AtomDollarUndef); TermDollarUndef = MkAtomTerm(AtomDollarUndef); - AtomDomainError = AtomAdjust(AtomDomainError); TermDomainError = MkAtomTerm(AtomDomainError); - AtomDoStaticClause = AtomAdjust(AtomDoStaticClause); TermDoStaticClause = MkAtomTerm(AtomDoStaticClause); - AtomDots = AtomAdjust(AtomDots); TermDots = MkAtomTerm(AtomDots); - AtomDOUBLE = AtomAdjust(AtomDOUBLE); TermDOUBLE = MkAtomTerm(AtomDOUBLE); - AtomDoubleSlash = AtomAdjust(AtomDoubleSlash); TermDoubleSlash = MkAtomTerm(AtomDoubleSlash); - AtomE = AtomAdjust(AtomE); TermE = MkAtomTerm(AtomE); - AtomEOFBeforeEOT = AtomAdjust(AtomEOFBeforeEOT); TermEOFBeforeEOT = MkAtomTerm(AtomEOFBeforeEOT); - AtomEQ = AtomAdjust(AtomEQ); TermEQ = MkAtomTerm(AtomEQ); - AtomEmptyAtom = AtomAdjust(AtomEmptyAtom); TermEmptyAtom = MkAtomTerm(AtomEmptyAtom); - AtomEncoding = AtomAdjust(AtomEncoding); TermEncoding = MkAtomTerm(AtomEncoding); - AtomEndOfStream = AtomAdjust(AtomEndOfStream); TermEndOfStream = MkAtomTerm(AtomEndOfStream); - AtomEof = AtomAdjust(AtomEof); TermEof = MkAtomTerm(AtomEof); - AtomEOfCode = AtomAdjust(AtomEOfCode); TermEOfCode = MkAtomTerm(AtomEOfCode); - AtomEq = AtomAdjust(AtomEq); TermEq = MkAtomTerm(AtomEq); - AtomError = AtomAdjust(AtomError); TermError = MkAtomTerm(AtomError); - AtomException = AtomAdjust(AtomException); TermException = MkAtomTerm(AtomException); - AtomExtensions = AtomAdjust(AtomExtensions); TermExtensions = MkAtomTerm(AtomExtensions); - AtomEvaluable = AtomAdjust(AtomEvaluable); TermEvaluable = MkAtomTerm(AtomEvaluable); - AtomEvaluationError = AtomAdjust(AtomEvaluationError); TermEvaluationError = MkAtomTerm(AtomEvaluationError); - AtomExecutable = AtomAdjust(AtomExecutable); TermExecutable = MkAtomTerm(AtomExecutable); - AtomExecute = AtomAdjust(AtomExecute); TermExecute = MkAtomTerm(AtomExecute); - AtomExecAnswers = AtomAdjust(AtomExecAnswers); TermExecAnswers = MkAtomTerm(AtomExecAnswers); - AtomExecuteInMod = AtomAdjust(AtomExecuteInMod); TermExecuteInMod = MkAtomTerm(AtomExecuteInMod); - AtomExecuteWithin = AtomAdjust(AtomExecuteWithin); TermExecuteWithin = MkAtomTerm(AtomExecuteWithin); - AtomExecuteWoMod = AtomAdjust(AtomExecuteWoMod); TermExecuteWoMod = MkAtomTerm(AtomExecuteWoMod); - AtomExist = AtomAdjust(AtomExist); TermExist = MkAtomTerm(AtomExist); - AtomExists = AtomAdjust(AtomExists); TermExists = MkAtomTerm(AtomExists); - AtomExit = AtomAdjust(AtomExit); TermExit = MkAtomTerm(AtomExit); - AtomExistenceError = AtomAdjust(AtomExistenceError); TermExistenceError = MkAtomTerm(AtomExistenceError); - AtomExoClause = AtomAdjust(AtomExoClause); TermExoClause = MkAtomTerm(AtomExoClause); - AtomExpectedNumber = AtomAdjust(AtomExpectedNumber); TermExpectedNumber = MkAtomTerm(AtomExpectedNumber); - AtomExpand = AtomAdjust(AtomExpand); TermExpand = MkAtomTerm(AtomExpand); - AtomExtendFileSearchPath = AtomAdjust(AtomExtendFileSearchPath); TermExtendFileSearchPath = MkAtomTerm(AtomExtendFileSearchPath); - AtomExtendsions = AtomAdjust(AtomExtendsions); TermExtendsions = MkAtomTerm(AtomExtendsions); - AtomFB = AtomAdjust(AtomFB); TermFB = MkAtomTerm(AtomFB); - AtomFail = AtomAdjust(AtomFail); TermFail = MkAtomTerm(AtomFail); - AtomFalse = AtomAdjust(AtomFalse); TermFalse = MkAtomTerm(AtomFalse); - AtomFast = AtomAdjust(AtomFast); TermFast = MkAtomTerm(AtomFast); - AtomFastFail = AtomAdjust(AtomFastFail); TermFastFail = MkAtomTerm(AtomFastFail); - AtomFileErrors = AtomAdjust(AtomFileErrors); TermFileErrors = MkAtomTerm(AtomFileErrors); - AtomFileerrors = AtomAdjust(AtomFileerrors); TermFileerrors = MkAtomTerm(AtomFileerrors); - AtomFileType = AtomAdjust(AtomFileType); TermFileType = MkAtomTerm(AtomFileType); - AtomFirst = AtomAdjust(AtomFirst); TermFirst = MkAtomTerm(AtomFirst); - AtomFloat = AtomAdjust(AtomFloat); TermFloat = MkAtomTerm(AtomFloat); - AtomFloatFormat = AtomAdjust(AtomFloatFormat); TermFloatFormat = MkAtomTerm(AtomFloatFormat); - AtomFloatOverflow = AtomAdjust(AtomFloatOverflow); TermFloatOverflow = MkAtomTerm(AtomFloatOverflow); - AtomFloatUnderflow = AtomAdjust(AtomFloatUnderflow); TermFloatUnderflow = MkAtomTerm(AtomFloatUnderflow); - AtomFormat = AtomAdjust(AtomFormat); TermFormat = MkAtomTerm(AtomFormat); - AtomFormatAt = AtomAdjust(AtomFormatAt); TermFormatAt = MkAtomTerm(AtomFormatAt); - AtomFull = AtomAdjust(AtomFull); TermFull = MkAtomTerm(AtomFull); - AtomFunctor = AtomAdjust(AtomFunctor); TermFunctor = MkAtomTerm(AtomFunctor); - AtomGT = AtomAdjust(AtomGT); TermGT = MkAtomTerm(AtomGT); - AtomGVar = AtomAdjust(AtomGVar); TermGVar = MkAtomTerm(AtomGVar); - AtomGc = AtomAdjust(AtomGc); TermGc = MkAtomTerm(AtomGc); - AtomGcMargin = AtomAdjust(AtomGcMargin); TermGcMargin = MkAtomTerm(AtomGcMargin); - AtomGcTrace = AtomAdjust(AtomGcTrace); TermGcTrace = MkAtomTerm(AtomGcTrace); - AtomGcVerbose = AtomAdjust(AtomGcVerbose); TermGcVerbose = MkAtomTerm(AtomGcVerbose); - AtomGcVeryVerbose = AtomAdjust(AtomGcVeryVerbose); TermGcVeryVerbose = MkAtomTerm(AtomGcVeryVerbose); - AtomGeneratePredInfo = AtomAdjust(AtomGeneratePredInfo); TermGeneratePredInfo = MkAtomTerm(AtomGeneratePredInfo); - AtomGetwork = AtomAdjust(AtomGetwork); TermGetwork = MkAtomTerm(AtomGetwork); - AtomGetworkSeq = AtomAdjust(AtomGetworkSeq); TermGetworkSeq = MkAtomTerm(AtomGetworkSeq); - AtomGlob = AtomAdjust(AtomGlob); TermGlob = MkAtomTerm(AtomGlob); - AtomGlobal = AtomAdjust(AtomGlobal); TermGlobal = MkAtomTerm(AtomGlobal); - AtomGlobalSp = AtomAdjust(AtomGlobalSp); TermGlobalSp = MkAtomTerm(AtomGlobalSp); - AtomGlobalTrie = AtomAdjust(AtomGlobalTrie); TermGlobalTrie = MkAtomTerm(AtomGlobalTrie); - AtomGoalExpansion = AtomAdjust(AtomGoalExpansion); TermGoalExpansion = MkAtomTerm(AtomGoalExpansion); - AtomHat = AtomAdjust(AtomHat); TermHat = MkAtomTerm(AtomHat); - AtomHERE = AtomAdjust(AtomHERE); TermHERE = MkAtomTerm(AtomHERE); - AtomHandleThrow = AtomAdjust(AtomHandleThrow); TermHandleThrow = MkAtomTerm(AtomHandleThrow); - AtomHeap = AtomAdjust(AtomHeap); TermHeap = MkAtomTerm(AtomHeap); - AtomHeapUsed = AtomAdjust(AtomHeapUsed); TermHeapUsed = MkAtomTerm(AtomHeapUsed); - AtomHugeInt = AtomAdjust(AtomHugeInt); TermHugeInt = MkAtomTerm(AtomHugeInt); - AtomIDB = AtomAdjust(AtomIDB); TermIDB = MkAtomTerm(AtomIDB); - AtomIOMode = AtomAdjust(AtomIOMode); TermIOMode = MkAtomTerm(AtomIOMode); - AtomI = AtomAdjust(AtomI); TermI = MkAtomTerm(AtomI); - AtomId = AtomAdjust(AtomId); TermId = MkAtomTerm(AtomId); - AtomIgnore = AtomAdjust(AtomIgnore); TermIgnore = MkAtomTerm(AtomIgnore); - AtomInf = AtomAdjust(AtomInf); TermInf = MkAtomTerm(AtomInf); - AtomInfinity = AtomAdjust(AtomInfinity); TermInfinity = MkAtomTerm(AtomInfinity); - AtomInfo = AtomAdjust(AtomInfo); TermInfo = MkAtomTerm(AtomInfo); - AtomInitGoal = AtomAdjust(AtomInitGoal); TermInitGoal = MkAtomTerm(AtomInitGoal); - AtomInitProlog = AtomAdjust(AtomInitProlog); TermInitProlog = MkAtomTerm(AtomInitProlog); - AtomInStackExpansion = AtomAdjust(AtomInStackExpansion); TermInStackExpansion = MkAtomTerm(AtomInStackExpansion); - AtomInput = AtomAdjust(AtomInput); TermInput = MkAtomTerm(AtomInput); - AtomInstantiationError = AtomAdjust(AtomInstantiationError); TermInstantiationError = MkAtomTerm(AtomInstantiationError); - AtomInt = AtomAdjust(AtomInt); TermInt = MkAtomTerm(AtomInt); - AtomIntOverflow = AtomAdjust(AtomIntOverflow); TermIntOverflow = MkAtomTerm(AtomIntOverflow); - AtomInteger = AtomAdjust(AtomInteger); TermInteger = MkAtomTerm(AtomInteger); - AtomInternalCompilerError = AtomAdjust(AtomInternalCompilerError); TermInternalCompilerError = MkAtomTerm(AtomInternalCompilerError); - AtomIs = AtomAdjust(AtomIs); TermIs = MkAtomTerm(AtomIs); - AtomJ = AtomAdjust(AtomJ); TermJ = MkAtomTerm(AtomJ); - Atoml = AtomAdjust(Atoml); Terml = MkAtomTerm(Atoml); - AtomKey = AtomAdjust(AtomKey); TermKey = MkAtomTerm(AtomKey); - AtomLDLibraryPath = AtomAdjust(AtomLDLibraryPath); TermLDLibraryPath = MkAtomTerm(AtomLDLibraryPath); - AtomLONGINT = AtomAdjust(AtomLONGINT); TermLONGINT = MkAtomTerm(AtomLONGINT); - AtomLOOP = AtomAdjust(AtomLOOP); TermLOOP = MkAtomTerm(AtomLOOP); - AtomLoopStream = AtomAdjust(AtomLoopStream); TermLoopStream = MkAtomTerm(AtomLoopStream); - AtomLT = AtomAdjust(AtomLT); TermLT = MkAtomTerm(AtomLT); - AtomLastExecuteWithin = AtomAdjust(AtomLastExecuteWithin); TermLastExecuteWithin = MkAtomTerm(AtomLastExecuteWithin); - AtomLeash = AtomAdjust(AtomLeash); TermLeash = MkAtomTerm(AtomLeash); - AtomLeast = AtomAdjust(AtomLeast); TermLeast = MkAtomTerm(AtomLeast); - AtomLength = AtomAdjust(AtomLength); TermLength = MkAtomTerm(AtomLength); - AtomList = AtomAdjust(AtomList); TermList = MkAtomTerm(AtomList); - AtomLine = AtomAdjust(AtomLine); TermLine = MkAtomTerm(AtomLine); - AtomLive = AtomAdjust(AtomLive); TermLive = MkAtomTerm(AtomLive); - AtomLoadAnswers = AtomAdjust(AtomLoadAnswers); TermLoadAnswers = MkAtomTerm(AtomLoadAnswers); - AtomLocal = AtomAdjust(AtomLocal); TermLocal = MkAtomTerm(AtomLocal); - AtomLocalSp = AtomAdjust(AtomLocalSp); TermLocalSp = MkAtomTerm(AtomLocalSp); - AtomLocalTrie = AtomAdjust(AtomLocalTrie); TermLocalTrie = MkAtomTerm(AtomLocalTrie); - AtomMax = AtomAdjust(AtomMax); TermMax = MkAtomTerm(AtomMax); - AtomMaximum = AtomAdjust(AtomMaximum); TermMaximum = MkAtomTerm(AtomMaximum); - AtomMaxArity = AtomAdjust(AtomMaxArity); TermMaxArity = MkAtomTerm(AtomMaxArity); - AtomMaxFiles = AtomAdjust(AtomMaxFiles); TermMaxFiles = MkAtomTerm(AtomMaxFiles); - AtomMegaClause = AtomAdjust(AtomMegaClause); TermMegaClause = MkAtomTerm(AtomMegaClause); - AtomMetaCall = AtomAdjust(AtomMetaCall); TermMetaCall = MkAtomTerm(AtomMetaCall); - AtomMfClause = AtomAdjust(AtomMfClause); TermMfClause = MkAtomTerm(AtomMfClause); - AtomMin = AtomAdjust(AtomMin); TermMin = MkAtomTerm(AtomMin); - AtomMinimum = AtomAdjust(AtomMinimum); TermMinimum = MkAtomTerm(AtomMinimum); - AtomMinus = AtomAdjust(AtomMinus); TermMinus = MkAtomTerm(AtomMinus); - AtomModify = AtomAdjust(AtomModify); TermModify = MkAtomTerm(AtomModify); - AtomModule = AtomAdjust(AtomModule); TermModule = MkAtomTerm(AtomModule); - AtomMost = AtomAdjust(AtomMost); TermMost = MkAtomTerm(AtomMost); - AtomMulti = AtomAdjust(AtomMulti); TermMulti = MkAtomTerm(AtomMulti); - AtomMultiFile = AtomAdjust(AtomMultiFile); TermMultiFile = MkAtomTerm(AtomMultiFile); - AtomMultiple = AtomAdjust(AtomMultiple); TermMultiple = MkAtomTerm(AtomMultiple); - AtomMutable = AtomAdjust(AtomMutable); TermMutable = MkAtomTerm(AtomMutable); - AtomMutableVariable = AtomAdjust(AtomMutableVariable); TermMutableVariable = MkAtomTerm(AtomMutableVariable); - AtomMutex = AtomAdjust(AtomMutex); TermMutex = MkAtomTerm(AtomMutex); - AtomMyddasDB = AtomAdjust(AtomMyddasDB); TermMyddasDB = MkAtomTerm(AtomMyddasDB); - AtomMyddasGoal = AtomAdjust(AtomMyddasGoal); TermMyddasGoal = MkAtomTerm(AtomMyddasGoal); - AtomMyddasHost = AtomAdjust(AtomMyddasHost); TermMyddasHost = MkAtomTerm(AtomMyddasHost); - AtomMyddasPass = AtomAdjust(AtomMyddasPass); TermMyddasPass = MkAtomTerm(AtomMyddasPass); - AtomMyddasUser = AtomAdjust(AtomMyddasUser); TermMyddasUser = MkAtomTerm(AtomMyddasUser); - AtomMyddasVersionName = AtomAdjust(AtomMyddasVersionName); TermMyddasVersionName = MkAtomTerm(AtomMyddasVersionName); - AtomNan = AtomAdjust(AtomNan); TermNan = MkAtomTerm(AtomNan); - AtomNb = AtomAdjust(AtomNb); TermNb = MkAtomTerm(AtomNb); - AtomNbTerm = AtomAdjust(AtomNbTerm); TermNbTerm = MkAtomTerm(AtomNbTerm); - AtomNew = AtomAdjust(AtomNew); TermNew = MkAtomTerm(AtomNew); - AtomNewLine = AtomAdjust(AtomNewLine); TermNewLine = MkAtomTerm(AtomNewLine); - AtomNl = AtomAdjust(AtomNl); TermNl = MkAtomTerm(AtomNl); - AtomNoEffect = AtomAdjust(AtomNoEffect); TermNoEffect = MkAtomTerm(AtomNoEffect); - AtomNoMemory = AtomAdjust(AtomNoMemory); TermNoMemory = MkAtomTerm(AtomNoMemory); - AtomNone = AtomAdjust(AtomNone); TermNone = MkAtomTerm(AtomNone); - AtomNonEmptyList = AtomAdjust(AtomNonEmptyList); TermNonEmptyList = MkAtomTerm(AtomNonEmptyList); - AtomNot = AtomAdjust(AtomNot); TermNot = MkAtomTerm(AtomNot); - AtomNotImplemented = AtomAdjust(AtomNotImplemented); TermNotImplemented = MkAtomTerm(AtomNotImplemented); - AtomNotLessThanZero = AtomAdjust(AtomNotLessThanZero); TermNotLessThanZero = MkAtomTerm(AtomNotLessThanZero); - AtomNotNewline = AtomAdjust(AtomNotNewline); TermNotNewline = MkAtomTerm(AtomNotNewline); - AtomNotZero = AtomAdjust(AtomNotZero); TermNotZero = MkAtomTerm(AtomNotZero); - AtomNumber = AtomAdjust(AtomNumber); TermNumber = MkAtomTerm(AtomNumber); - AtomObj = AtomAdjust(AtomObj); TermObj = MkAtomTerm(AtomObj); - AtomOff = AtomAdjust(AtomOff); TermOff = MkAtomTerm(AtomOff); - AtomOffline = AtomAdjust(AtomOffline); TermOffline = MkAtomTerm(AtomOffline); - AtomOn = AtomAdjust(AtomOn); TermOn = MkAtomTerm(AtomOn); - AtomOnline = AtomAdjust(AtomOnline); TermOnline = MkAtomTerm(AtomOnline); - AtomOpen = AtomAdjust(AtomOpen); TermOpen = MkAtomTerm(AtomOpen); - AtomOperatingSystemError = AtomAdjust(AtomOperatingSystemError); TermOperatingSystemError = MkAtomTerm(AtomOperatingSystemError); - AtomOperatingSystemSupport = AtomAdjust(AtomOperatingSystemSupport); TermOperatingSystemSupport = MkAtomTerm(AtomOperatingSystemSupport); - AtomOperator = AtomAdjust(AtomOperator); TermOperator = MkAtomTerm(AtomOperator); - AtomOperatorPriority = AtomAdjust(AtomOperatorPriority); TermOperatorPriority = MkAtomTerm(AtomOperatorPriority); - AtomOperatorSpecifier = AtomAdjust(AtomOperatorSpecifier); TermOperatorSpecifier = MkAtomTerm(AtomOperatorSpecifier); - AtomOpt = AtomAdjust(AtomOpt); TermOpt = MkAtomTerm(AtomOpt); - AtomOtherwise = AtomAdjust(AtomOtherwise); TermOtherwise = MkAtomTerm(AtomOtherwise); - AtomOutOfAttvarsError = AtomAdjust(AtomOutOfAttvarsError); TermOutOfAttvarsError = MkAtomTerm(AtomOutOfAttvarsError); - AtomOutOfAuxspaceError = AtomAdjust(AtomOutOfAuxspaceError); TermOutOfAuxspaceError = MkAtomTerm(AtomOutOfAuxspaceError); - AtomOutOfHeapError = AtomAdjust(AtomOutOfHeapError); TermOutOfHeapError = MkAtomTerm(AtomOutOfHeapError); - AtomOutOfRange = AtomAdjust(AtomOutOfRange); TermOutOfRange = MkAtomTerm(AtomOutOfRange); - AtomOutOfStackError = AtomAdjust(AtomOutOfStackError); TermOutOfStackError = MkAtomTerm(AtomOutOfStackError); - AtomOutOfTrailError = AtomAdjust(AtomOutOfTrailError); TermOutOfTrailError = MkAtomTerm(AtomOutOfTrailError); - AtomOutput = AtomAdjust(AtomOutput); TermOutput = MkAtomTerm(AtomOutput); - AtomParameter = AtomAdjust(AtomParameter); TermParameter = MkAtomTerm(AtomParameter); - AtomPrologCommonsDir = AtomAdjust(AtomPrologCommonsDir); TermPrologCommonsDir = MkAtomTerm(AtomPrologCommonsDir); - AtomPast = AtomAdjust(AtomPast); TermPast = MkAtomTerm(AtomPast); - AtomPastEndOfStream = AtomAdjust(AtomPastEndOfStream); TermPastEndOfStream = MkAtomTerm(AtomPastEndOfStream); - AtomPermissionError = AtomAdjust(AtomPermissionError); TermPermissionError = MkAtomTerm(AtomPermissionError); - AtomPi = AtomAdjust(AtomPi); TermPi = MkAtomTerm(AtomPi); - AtomPipe = AtomAdjust(AtomPipe); TermPipe = MkAtomTerm(AtomPipe); - AtomPlus = AtomAdjust(AtomPlus); TermPlus = MkAtomTerm(AtomPlus); - AtomPointer = AtomAdjust(AtomPointer); TermPointer = MkAtomTerm(AtomPointer); - AtomPortray = AtomAdjust(AtomPortray); TermPortray = MkAtomTerm(AtomPortray); - AtomPredicateIndicator = AtomAdjust(AtomPredicateIndicator); TermPredicateIndicator = MkAtomTerm(AtomPredicateIndicator); - AtomPrimitive = AtomAdjust(AtomPrimitive); TermPrimitive = MkAtomTerm(AtomPrimitive); - AtomPrintMessage = AtomAdjust(AtomPrintMessage); TermPrintMessage = MkAtomTerm(AtomPrintMessage); - AtomPrivateProcedure = AtomAdjust(AtomPrivateProcedure); TermPrivateProcedure = MkAtomTerm(AtomPrivateProcedure); - AtomProcedure = AtomAdjust(AtomProcedure); TermProcedure = MkAtomTerm(AtomProcedure); - AtomProfile = AtomAdjust(AtomProfile); TermProfile = MkAtomTerm(AtomProfile); - AtomProlog = AtomAdjust(AtomProlog); TermProlog = MkAtomTerm(AtomProlog); - AtomProtectStack = AtomAdjust(AtomProtectStack); TermProtectStack = MkAtomTerm(AtomProtectStack); - AtomQly = AtomAdjust(AtomQly); TermQly = MkAtomTerm(AtomQly); - AtomQuery = AtomAdjust(AtomQuery); TermQuery = MkAtomTerm(AtomQuery); - AtomQueue = AtomAdjust(AtomQueue); TermQueue = MkAtomTerm(AtomQueue); - AtomQuiet = AtomAdjust(AtomQuiet); TermQuiet = MkAtomTerm(AtomQuiet); - AtomRadix = AtomAdjust(AtomRadix); TermRadix = MkAtomTerm(AtomRadix); - AtomRandom = AtomAdjust(AtomRandom); TermRandom = MkAtomTerm(AtomRandom); - AtomRange = AtomAdjust(AtomRange); TermRange = MkAtomTerm(AtomRange); - AtomRDiv = AtomAdjust(AtomRDiv); TermRDiv = MkAtomTerm(AtomRDiv); - AtomRead = AtomAdjust(AtomRead); TermRead = MkAtomTerm(AtomRead); - AtomReadOnly = AtomAdjust(AtomReadOnly); TermReadOnly = MkAtomTerm(AtomReadOnly); - AtomReadWrite = AtomAdjust(AtomReadWrite); TermReadWrite = MkAtomTerm(AtomReadWrite); - AtomReadutil = AtomAdjust(AtomReadutil); TermReadutil = MkAtomTerm(AtomReadutil); - AtomReconsult = AtomAdjust(AtomReconsult); TermReconsult = MkAtomTerm(AtomReconsult); - AtomRecordedP = AtomAdjust(AtomRecordedP); TermRecordedP = MkAtomTerm(AtomRecordedP); - AtomRecordedWithKey = AtomAdjust(AtomRecordedWithKey); TermRecordedWithKey = MkAtomTerm(AtomRecordedWithKey); - AtomRedefineWarnings = AtomAdjust(AtomRedefineWarnings); TermRedefineWarnings = MkAtomTerm(AtomRedefineWarnings); - AtomRedoFreeze = AtomAdjust(AtomRedoFreeze); TermRedoFreeze = MkAtomTerm(AtomRedoFreeze); - AtomRefoundVar = AtomAdjust(AtomRefoundVar); TermRefoundVar = MkAtomTerm(AtomRefoundVar); - AtomRelativeTo = AtomAdjust(AtomRelativeTo); TermRelativeTo = MkAtomTerm(AtomRelativeTo); - AtomRepeat = AtomAdjust(AtomRepeat); TermRepeat = MkAtomTerm(AtomRepeat); - AtomRepeatSpace = AtomAdjust(AtomRepeatSpace); TermRepeatSpace = MkAtomTerm(AtomRepeatSpace); - AtomReposition = AtomAdjust(AtomReposition); TermReposition = MkAtomTerm(AtomReposition); - AtomRepresentationError = AtomAdjust(AtomRepresentationError); TermRepresentationError = MkAtomTerm(AtomRepresentationError); - AtomReset = AtomAdjust(AtomReset); TermReset = MkAtomTerm(AtomReset); - AtomResize = AtomAdjust(AtomResize); TermResize = MkAtomTerm(AtomResize); - AtomResourceError = AtomAdjust(AtomResourceError); TermResourceError = MkAtomTerm(AtomResourceError); - AtomRestoreRegs = AtomAdjust(AtomRestoreRegs); TermRestoreRegs = MkAtomTerm(AtomRestoreRegs); - AtomRetry = AtomAdjust(AtomRetry); TermRetry = MkAtomTerm(AtomRetry); - AtomRetryCounter = AtomAdjust(AtomRetryCounter); TermRetryCounter = MkAtomTerm(AtomRetryCounter); - AtomRTree = AtomAdjust(AtomRTree); TermRTree = MkAtomTerm(AtomRTree); - AtomSafe = AtomAdjust(AtomSafe); TermSafe = MkAtomTerm(AtomSafe); - AtomSafeCallCleanup = AtomAdjust(AtomSafeCallCleanup); TermSafeCallCleanup = MkAtomTerm(AtomSafeCallCleanup); - AtomSame = AtomAdjust(AtomSame); TermSame = MkAtomTerm(AtomSame); - AtomSemic = AtomAdjust(AtomSemic); TermSemic = MkAtomTerm(AtomSemic); - AtomShiftCountOverflow = AtomAdjust(AtomShiftCountOverflow); TermShiftCountOverflow = MkAtomTerm(AtomShiftCountOverflow); - AtomSigAlarm = AtomAdjust(AtomSigAlarm); TermSigAlarm = MkAtomTerm(AtomSigAlarm); - AtomSigBreak = AtomAdjust(AtomSigBreak); TermSigBreak = MkAtomTerm(AtomSigBreak); - AtomSigCreep = AtomAdjust(AtomSigCreep); TermSigCreep = MkAtomTerm(AtomSigCreep); - AtomSigDebug = AtomAdjust(AtomSigDebug); TermSigDebug = MkAtomTerm(AtomSigDebug); - AtomSigDelayCreep = AtomAdjust(AtomSigDelayCreep); TermSigDelayCreep = MkAtomTerm(AtomSigDelayCreep); - AtomSigFPE = AtomAdjust(AtomSigFPE); TermSigFPE = MkAtomTerm(AtomSigFPE); - AtomSigHup = AtomAdjust(AtomSigHup); TermSigHup = MkAtomTerm(AtomSigHup); - AtomSigInt = AtomAdjust(AtomSigInt); TermSigInt = MkAtomTerm(AtomSigInt); - AtomSigIti = AtomAdjust(AtomSigIti); TermSigIti = MkAtomTerm(AtomSigIti); - AtomSigPending = AtomAdjust(AtomSigPending); TermSigPending = MkAtomTerm(AtomSigPending); - AtomSigPipe = AtomAdjust(AtomSigPipe); TermSigPipe = MkAtomTerm(AtomSigPipe); - AtomSigStackDump = AtomAdjust(AtomSigStackDump); TermSigStackDump = MkAtomTerm(AtomSigStackDump); - AtomSigStatistics = AtomAdjust(AtomSigStatistics); TermSigStatistics = MkAtomTerm(AtomSigStatistics); - AtomSigTrace = AtomAdjust(AtomSigTrace); TermSigTrace = MkAtomTerm(AtomSigTrace); - AtomSigUsr1 = AtomAdjust(AtomSigUsr1); TermSigUsr1 = MkAtomTerm(AtomSigUsr1); - AtomSigUsr2 = AtomAdjust(AtomSigUsr2); TermSigUsr2 = MkAtomTerm(AtomSigUsr2); - AtomSigVTAlarm = AtomAdjust(AtomSigVTAlarm); TermSigVTAlarm = MkAtomTerm(AtomSigVTAlarm); - AtomSigWakeUp = AtomAdjust(AtomSigWakeUp); TermSigWakeUp = MkAtomTerm(AtomSigWakeUp); - AtomSilent = AtomAdjust(AtomSilent); TermSilent = MkAtomTerm(AtomSilent); - AtomSingle = AtomAdjust(AtomSingle); TermSingle = MkAtomTerm(AtomSingle); - AtomSingleVarWarnings = AtomAdjust(AtomSingleVarWarnings); TermSingleVarWarnings = MkAtomTerm(AtomSingleVarWarnings); - AtomSingleton = AtomAdjust(AtomSingleton); TermSingleton = MkAtomTerm(AtomSingleton); - AtomSlash = AtomAdjust(AtomSlash); TermSlash = MkAtomTerm(AtomSlash); - AtomSocket = AtomAdjust(AtomSocket); TermSocket = MkAtomTerm(AtomSocket); - AtomSolutions = AtomAdjust(AtomSolutions); TermSolutions = MkAtomTerm(AtomSolutions); - AtomSource = AtomAdjust(AtomSource); TermSource = MkAtomTerm(AtomSource); - AtomSourceSink = AtomAdjust(AtomSourceSink); TermSourceSink = MkAtomTerm(AtomSourceSink); - AtomSpy = AtomAdjust(AtomSpy); TermSpy = MkAtomTerm(AtomSpy); - AtomStack = AtomAdjust(AtomStack); TermStack = MkAtomTerm(AtomStack); - AtomStackFree = AtomAdjust(AtomStackFree); TermStackFree = MkAtomTerm(AtomStackFree); - AtomStartupSavedState = AtomAdjust(AtomStartupSavedState); TermStartupSavedState = MkAtomTerm(AtomStartupSavedState); - AtomStaticClause = AtomAdjust(AtomStaticClause); TermStaticClause = MkAtomTerm(AtomStaticClause); - AtomStaticProcedure = AtomAdjust(AtomStaticProcedure); TermStaticProcedure = MkAtomTerm(AtomStaticProcedure); - AtomStream = AtomAdjust(AtomStream); TermStream = MkAtomTerm(AtomStream); - AtomSWIStream = AtomAdjust(AtomSWIStream); TermSWIStream = MkAtomTerm(AtomSWIStream); - AtomVStream = AtomAdjust(AtomVStream); TermVStream = MkAtomTerm(AtomVStream); - AtomStreams = AtomAdjust(AtomStreams); TermStreams = MkAtomTerm(AtomStreams); - AtomStreamOrAlias = AtomAdjust(AtomStreamOrAlias); TermStreamOrAlias = MkAtomTerm(AtomStreamOrAlias); - AtomStreamPos = AtomAdjust(AtomStreamPos); TermStreamPos = MkAtomTerm(AtomStreamPos); - AtomStreamPosition = AtomAdjust(AtomStreamPosition); TermStreamPosition = MkAtomTerm(AtomStreamPosition); - AtomString = AtomAdjust(AtomString); TermString = MkAtomTerm(AtomString); - AtomStyleCheck = AtomAdjust(AtomStyleCheck); TermStyleCheck = MkAtomTerm(AtomStyleCheck); - AtomSTRING = AtomAdjust(AtomSTRING); TermSTRING = MkAtomTerm(AtomSTRING); - AtomSwi = AtomAdjust(AtomSwi); TermSwi = MkAtomTerm(AtomSwi); - AtomSymbolChar = AtomAdjust(AtomSymbolChar); TermSymbolChar = MkAtomTerm(AtomSymbolChar); - AtomSyntaxError = AtomAdjust(AtomSyntaxError); TermSyntaxError = MkAtomTerm(AtomSyntaxError); - AtomSyntaxErrors = AtomAdjust(AtomSyntaxErrors); TermSyntaxErrors = MkAtomTerm(AtomSyntaxErrors); - AtomSyntaxErrorHandler = AtomAdjust(AtomSyntaxErrorHandler); TermSyntaxErrorHandler = MkAtomTerm(AtomSyntaxErrorHandler); - AtomSystem = AtomAdjust(AtomSystem); TermSystem = MkAtomTerm(AtomSystem); - AtomSystemError = AtomAdjust(AtomSystemError); TermSystemError = MkAtomTerm(AtomSystemError); - AtomSystemLibraryDir = AtomAdjust(AtomSystemLibraryDir); TermSystemLibraryDir = MkAtomTerm(AtomSystemLibraryDir); - AtomT = AtomAdjust(AtomT); TermT = MkAtomTerm(AtomT); - AtomTerm = AtomAdjust(AtomTerm); TermTerm = MkAtomTerm(AtomTerm); - AtomTermExpansion = AtomAdjust(AtomTermExpansion); TermTermExpansion = MkAtomTerm(AtomTermExpansion); - AtomTerms = AtomAdjust(AtomTerms); TermTerms = MkAtomTerm(AtomTerms); - AtomText = AtomAdjust(AtomText); TermText = MkAtomTerm(AtomText); - AtomTextStream = AtomAdjust(AtomTextStream); TermTextStream = MkAtomTerm(AtomTextStream); - AtomThread = AtomAdjust(AtomThread); TermThread = MkAtomTerm(AtomThread); - AtomThreads = AtomAdjust(AtomThreads); TermThreads = MkAtomTerm(AtomThreads); - AtomThrow = AtomAdjust(AtomThrow); TermThrow = MkAtomTerm(AtomThrow); - AtomTimeOutSpec = AtomAdjust(AtomTimeOutSpec); TermTimeOutSpec = MkAtomTerm(AtomTimeOutSpec); - AtomTimeoutError = AtomAdjust(AtomTimeoutError); TermTimeoutError = MkAtomTerm(AtomTimeoutError); - AtomTopLevelGoal = AtomAdjust(AtomTopLevelGoal); TermTopLevelGoal = MkAtomTerm(AtomTopLevelGoal); - AtomTopThreadGoal = AtomAdjust(AtomTopThreadGoal); TermTopThreadGoal = MkAtomTerm(AtomTopThreadGoal); - AtomTraceMetaCall = AtomAdjust(AtomTraceMetaCall); TermTraceMetaCall = MkAtomTerm(AtomTraceMetaCall); - AtomTrail = AtomAdjust(AtomTrail); - AtomTrue = AtomAdjust(AtomTrue); TermTrue = MkAtomTerm(AtomTrue); - AtomTty = AtomAdjust(AtomTty); TermTty = MkAtomTerm(AtomTty); - AtomTtys = AtomAdjust(AtomTtys); TermTtys = MkAtomTerm(AtomTtys); - AtomTuple = AtomAdjust(AtomTuple); TermTuple = MkAtomTerm(AtomTuple); - AtomTxt = AtomAdjust(AtomTxt); TermTxt = MkAtomTerm(AtomTxt); - AtomTypeError = AtomAdjust(AtomTypeError); TermTypeError = MkAtomTerm(AtomTypeError); - AtomUndefined = AtomAdjust(AtomUndefined); TermUndefined = MkAtomTerm(AtomUndefined); - AtomUndefp = AtomAdjust(AtomUndefp); TermUndefp = MkAtomTerm(AtomUndefp); - AtomUndefp0 = AtomAdjust(AtomUndefp0); TermUndefp0 = MkAtomTerm(AtomUndefp0); - AtomUnderflow = AtomAdjust(AtomUnderflow); TermUnderflow = MkAtomTerm(AtomUnderflow); - AtomUnificationStack = AtomAdjust(AtomUnificationStack); TermUnificationStack = MkAtomTerm(AtomUnificationStack); - AtomUnique = AtomAdjust(AtomUnique); TermUnique = MkAtomTerm(AtomUnique); - AtomUnsignedByte = AtomAdjust(AtomUnsignedByte); TermUnsignedByte = MkAtomTerm(AtomUnsignedByte); - AtomUnsignedChar = AtomAdjust(AtomUnsignedChar); TermUnsignedChar = MkAtomTerm(AtomUnsignedChar); - AtomUser = AtomAdjust(AtomUser); TermUser = MkAtomTerm(AtomUser); - AtomUserErr = AtomAdjust(AtomUserErr); TermUserErr = MkAtomTerm(AtomUserErr); - AtomUserIn = AtomAdjust(AtomUserIn); TermUserIn = MkAtomTerm(AtomUserIn); - AtomUserOut = AtomAdjust(AtomUserOut); TermUserOut = MkAtomTerm(AtomUserOut); - AtomDollarVar = AtomAdjust(AtomDollarVar); TermDollarVar = MkAtomTerm(AtomDollarVar); - AtomVBar = AtomAdjust(AtomVBar); TermVBar = MkAtomTerm(AtomVBar); - AtomVarBranches = AtomAdjust(AtomVarBranches); TermVarBranches = MkAtomTerm(AtomVarBranches); - AtomVariableNames = AtomAdjust(AtomVariableNames); TermVariableNames = MkAtomTerm(AtomVariableNames); - AtomHiddenVar = AtomAdjust(AtomHiddenVar); TermHiddenVar = MkAtomTerm(AtomHiddenVar); - AtomVariable = AtomAdjust(AtomVariable); TermVariable = MkAtomTerm(AtomVariable); - AtomVerbose = AtomAdjust(AtomVerbose); TermVerbose = MkAtomTerm(AtomVerbose); - AtomVerboseFileSearch = AtomAdjust(AtomVerboseFileSearch); TermVerboseFileSearch = MkAtomTerm(AtomVerboseFileSearch); - AtomVersionNumber = AtomAdjust(AtomVersionNumber); TermVersionNumber = MkAtomTerm(AtomVersionNumber); - AtomVeryVerbose = AtomAdjust(AtomVeryVerbose); TermVeryVerbose = MkAtomTerm(AtomVeryVerbose); - AtomWakeUpGoal = AtomAdjust(AtomWakeUpGoal); TermWakeUpGoal = MkAtomTerm(AtomWakeUpGoal); - AtomWarning = AtomAdjust(AtomWarning); TermWarning = MkAtomTerm(AtomWarning); - AtomWhen = AtomAdjust(AtomWhen); TermWhen = MkAtomTerm(AtomWhen); - AtomWrite = AtomAdjust(AtomWrite); TermWrite = MkAtomTerm(AtomWrite); - AtomWriteTerm = AtomAdjust(AtomWriteTerm); TermWriteTerm = MkAtomTerm(AtomWriteTerm); - AtomXml = AtomAdjust(AtomXml); TermXml = MkAtomTerm(AtomXml); - AtomYapHacks = AtomAdjust(AtomYapHacks); TermYapHacks = MkAtomTerm(AtomYapHacks); - AtomZeroDivisor = AtomAdjust(AtomZeroDivisor); TermZeroDivisor = MkAtomTerm(AtomZeroDivisor); - FunctorAfInet = FuncAdjust(FunctorAfInet); - FunctorAfLocal = FuncAdjust(FunctorAfLocal); - FunctorAfUnix = FuncAdjust(FunctorAfUnix); - FunctorAltNot = FuncAdjust(FunctorAltNot); - FunctorArg = FuncAdjust(FunctorArg); - FunctorArrayEntry = FuncAdjust(FunctorArrayEntry); - FunctorArrow = FuncAdjust(FunctorArrow); - FunctorDoubleArrow = FuncAdjust(FunctorDoubleArrow); - FunctorAssert1 = FuncAdjust(FunctorAssert1); - FunctorAssert = FuncAdjust(FunctorAssert); - FunctorAtFoundOne = FuncAdjust(FunctorAtFoundOne); - FunctorAtom = FuncAdjust(FunctorAtom); - FunctorAtt1 = FuncAdjust(FunctorAtt1); - FunctorAttGoal = FuncAdjust(FunctorAttGoal); - FunctorBraces = FuncAdjust(FunctorBraces); - FunctorCall = FuncAdjust(FunctorCall); - FunctorCatch = FuncAdjust(FunctorCatch); - FunctorChangeModule = FuncAdjust(FunctorChangeModule); - FunctorChars = FuncAdjust(FunctorChars); - FunctorChars1 = FuncAdjust(FunctorChars1); - FunctorCleanCall = FuncAdjust(FunctorCleanCall); - FunctorClist = FuncAdjust(FunctorClist); - FunctorCodes = FuncAdjust(FunctorCodes); - FunctorCodes1 = FuncAdjust(FunctorCodes1); - FunctorColon = FuncAdjust(FunctorColon); - FunctorComma = FuncAdjust(FunctorComma); - FunctorCommentHook = FuncAdjust(FunctorCommentHook); - FunctorContext2 = FuncAdjust(FunctorContext2); - FunctorConsistencyError = FuncAdjust(FunctorConsistencyError); - FunctorCreep = FuncAdjust(FunctorCreep); - FunctorCsult = FuncAdjust(FunctorCsult); - FunctorCurrentModule = FuncAdjust(FunctorCurrentModule); - FunctorCutBy = FuncAdjust(FunctorCutBy); - FunctorDBREF = FuncAdjust(FunctorDBREF); - FunctorDiff = FuncAdjust(FunctorDiff); - FunctorDoLogUpdClause = FuncAdjust(FunctorDoLogUpdClause); - FunctorDoLogUpdClause0 = FuncAdjust(FunctorDoLogUpdClause0); - FunctorDoLogUpdClauseErase = FuncAdjust(FunctorDoLogUpdClauseErase); - FunctorDoStaticClause = FuncAdjust(FunctorDoStaticClause); - FunctorDollar = FuncAdjust(FunctorDollar); - FunctorDollarVar = FuncAdjust(FunctorDollarVar); - FunctorDomainError = FuncAdjust(FunctorDomainError); - FunctorDot = FuncAdjust(FunctorDot); - FunctorDot10 = FuncAdjust(FunctorDot10); - FunctorDot11 = FuncAdjust(FunctorDot11); - FunctorDot12 = FuncAdjust(FunctorDot12); - FunctorDot2 = FuncAdjust(FunctorDot2); - FunctorDot3 = FuncAdjust(FunctorDot3); - FunctorDot4 = FuncAdjust(FunctorDot4); - FunctorDot5 = FuncAdjust(FunctorDot5); - FunctorDot6 = FuncAdjust(FunctorDot6); - FunctorDot7 = FuncAdjust(FunctorDot7); - FunctorDot8 = FuncAdjust(FunctorDot8); - FunctorDot9 = FuncAdjust(FunctorDot9); - FunctorDoubleArrow = FuncAdjust(FunctorDoubleArrow); - FunctorDoubleSlash = FuncAdjust(FunctorDoubleSlash); - FunctorEmptySquareBrackets = FuncAdjust(FunctorEmptySquareBrackets); - FunctorEq = FuncAdjust(FunctorEq); - FunctorError = FuncAdjust(FunctorError); - FunctorEvaluationError = FuncAdjust(FunctorEvaluationError); - FunctorException = FuncAdjust(FunctorException); - FunctorExecute2InMod = FuncAdjust(FunctorExecute2InMod); - FunctorExecuteInMod = FuncAdjust(FunctorExecuteInMod); - FunctorExecuteWithin = FuncAdjust(FunctorExecuteWithin); - FunctorExistenceError = FuncAdjust(FunctorExistenceError); - FunctorExoClause = FuncAdjust(FunctorExoClause); - FunctorFunctor = FuncAdjust(FunctorFunctor); - FunctorGAtom = FuncAdjust(FunctorGAtom); - FunctorGAtomic = FuncAdjust(FunctorGAtomic); - FunctorGCompound = FuncAdjust(FunctorGCompound); - FunctorGFloat = FuncAdjust(FunctorGFloat); - FunctorGFormatAt = FuncAdjust(FunctorGFormatAt); - FunctorGInteger = FuncAdjust(FunctorGInteger); - FunctorGNumber = FuncAdjust(FunctorGNumber); - FunctorGPrimitive = FuncAdjust(FunctorGPrimitive); - FunctorGVar = FuncAdjust(FunctorGVar); - FunctorGeneratePredInfo = FuncAdjust(FunctorGeneratePredInfo); - FunctorGoalExpansion2 = FuncAdjust(FunctorGoalExpansion2); - FunctorGoalExpansion = FuncAdjust(FunctorGoalExpansion); - FunctorHandleThrow = FuncAdjust(FunctorHandleThrow); - FunctorHat = FuncAdjust(FunctorHat); - FunctorI = FuncAdjust(FunctorI); - FunctorId = FuncAdjust(FunctorId); - FunctorInfo1 = FuncAdjust(FunctorInfo1); - FunctorInfo2 = FuncAdjust(FunctorInfo2); - FunctorInfo3 = FuncAdjust(FunctorInfo3); - FunctorInfo4 = FuncAdjust(FunctorInfo4); - FunctorIs = FuncAdjust(FunctorIs); - FunctorJ = FuncAdjust(FunctorJ); - FunctorLastExecuteWithin = FuncAdjust(FunctorLastExecuteWithin); - FunctorList = FuncAdjust(FunctorList); - FunctorLOOP = FuncAdjust(FunctorLOOP); - FunctorMegaClause = FuncAdjust(FunctorMegaClause); - FunctorMetaCall = FuncAdjust(FunctorMetaCall); - FunctorMinus = FuncAdjust(FunctorMinus); - FunctorModule = FuncAdjust(FunctorModule); - FunctorMultiFileClause = FuncAdjust(FunctorMultiFileClause); - FunctorMutable = FuncAdjust(FunctorMutable); - FunctorMutex = FuncAdjust(FunctorMutex); - FunctorNotImplemented = FuncAdjust(FunctorNotImplemented); - FunctorNBQueue = FuncAdjust(FunctorNBQueue); - FunctorNot = FuncAdjust(FunctorNot); - FunctorObj = FuncAdjust(FunctorObj); - FunctorOr = FuncAdjust(FunctorOr); - FunctorPermissionError = FuncAdjust(FunctorPermissionError); - FunctorPlus = FuncAdjust(FunctorPlus); - FunctorPortray = FuncAdjust(FunctorPortray); - FunctorPrintMessage = FuncAdjust(FunctorPrintMessage); - FunctorProcedure = FuncAdjust(FunctorProcedure); - FunctorPrologConstraint = FuncAdjust(FunctorPrologConstraint); - FunctorProtectStack = FuncAdjust(FunctorProtectStack); - FunctorQuery = FuncAdjust(FunctorQuery); - FunctorRecordedWithKey = FuncAdjust(FunctorRecordedWithKey); - FunctorRDiv = FuncAdjust(FunctorRDiv); - FunctorRedoFreeze = FuncAdjust(FunctorRedoFreeze); - FunctorRepresentationError = FuncAdjust(FunctorRepresentationError); - FunctorResourceError = FuncAdjust(FunctorResourceError); - FunctorRestoreRegs = FuncAdjust(FunctorRestoreRegs); - FunctorRestoreRegs1 = FuncAdjust(FunctorRestoreRegs1); - FunctorSafe = FuncAdjust(FunctorSafe); - FunctorSafeCallCleanup = FuncAdjust(FunctorSafeCallCleanup); - FunctorSame = FuncAdjust(FunctorSame); - FunctorSlash = FuncAdjust(FunctorSlash); - FunctorStaticClause = FuncAdjust(FunctorStaticClause); - FunctorStream = FuncAdjust(FunctorStream); - FunctorStreamEOS = FuncAdjust(FunctorStreamEOS); - FunctorStreamPos = FuncAdjust(FunctorStreamPos); - FunctorString1 = FuncAdjust(FunctorString1); - FunctorStyleCheck = FuncAdjust(FunctorStyleCheck); - FunctorSyntaxError = FuncAdjust(FunctorSyntaxError); - FunctorShortSyntaxError = FuncAdjust(FunctorShortSyntaxError); - FunctorTermExpansion = FuncAdjust(FunctorTermExpansion); - FunctorThreadRun = FuncAdjust(FunctorThreadRun); - FunctorThrow = FuncAdjust(FunctorThrow); - FunctorTimeoutError = FuncAdjust(FunctorTimeoutError); - FunctorTraceMetaCall = FuncAdjust(FunctorTraceMetaCall); - FunctorTypeError = FuncAdjust(FunctorTypeError); - FunctorUMinus = FuncAdjust(FunctorUMinus); - FunctorUPlus = FuncAdjust(FunctorUPlus); - FunctorVBar = FuncAdjust(FunctorVBar); - FunctorWriteTerm = FuncAdjust(FunctorWriteTerm); - FunctorHiddenVar = FuncAdjust(FunctorHiddenVar); + + /* This file, ratoms.h, was generated automatically by "yap -L misc/buildatoms" + {lease do not update, update misc/ATOMS instead */ + + Atom3Dots = AtomAdjust(Atom3Dots); + AtomAbol = AtomAdjust(AtomAbol); TermAbol = MkAtomTerm(AtomAbol); + AtomAccess = AtomAdjust(AtomAccess); TermAccess = MkAtomTerm(AtomAccess); + AtomAfInet = AtomAdjust(AtomAfInet); TermAfInet = MkAtomTerm(AtomAfInet); + AtomAfLocal = AtomAdjust(AtomAfLocal); TermAfLocal = MkAtomTerm(AtomAfLocal); + AtomAfUnix = AtomAdjust(AtomAfUnix); TermAfUnix = MkAtomTerm(AtomAfUnix); + AtomAlarm = AtomAdjust(AtomAlarm); TermAlarm = MkAtomTerm(AtomAlarm); + AtomAlias = AtomAdjust(AtomAlias); TermAlias = MkAtomTerm(AtomAlias); + AtomAll = AtomAdjust(AtomAll); TermAll = MkAtomTerm(AtomAll); + AtomAltNot = AtomAdjust(AtomAltNot); TermAltNot = MkAtomTerm(AtomAltNot); + AtomAnswer = AtomAdjust(AtomAnswer); TermAnswer = MkAtomTerm(AtomAnswer); + AtomAny = AtomAdjust(AtomAny); TermAny = MkAtomTerm(AtomAny); + AtomAppend = AtomAdjust(AtomAppend); TermAppend = MkAtomTerm(AtomAppend); + AtomArg = AtomAdjust(AtomArg); TermArg = MkAtomTerm(AtomArg); + AtomArray = AtomAdjust(AtomArray); TermArray = MkAtomTerm(AtomArray); + AtomArrayAccess = AtomAdjust(AtomArrayAccess); TermArrayAccess = MkAtomTerm(AtomArrayAccess); + AtomArrayOverflow = AtomAdjust(AtomArrayOverflow); TermArrayOverflow = MkAtomTerm(AtomArrayOverflow); + AtomArrayType = AtomAdjust(AtomArrayType); TermArrayType = MkAtomTerm(AtomArrayType); + AtomArrow = AtomAdjust(AtomArrow); TermArrow = MkAtomTerm(AtomArrow); + AtomAttributedModule = AtomAdjust(AtomAttributedModule); TermAttributedModule = MkAtomTerm(AtomAttributedModule); + AtomDoubleArrow = AtomAdjust(AtomDoubleArrow); TermDoubleArrow = MkAtomTerm(AtomDoubleArrow); + AtomAssert = AtomAdjust(AtomAssert); TermAssert = MkAtomTerm(AtomAssert); + AtomBeginBracket = AtomAdjust(AtomBeginBracket); TermBeginBracket = MkAtomTerm(AtomBeginBracket); + AtomEndBracket = AtomAdjust(AtomEndBracket); TermEndBracket = MkAtomTerm(AtomEndBracket); + AtomBeginSquareBracket = AtomAdjust(AtomBeginSquareBracket); TermBeginSquareBracket = MkAtomTerm(AtomBeginSquareBracket); + AtomEndSquareBracket = AtomAdjust(AtomEndSquareBracket); TermEndSquareBracket = MkAtomTerm(AtomEndSquareBracket); + AtomBeginCurlyBracket = AtomAdjust(AtomBeginCurlyBracket); TermBeginCurlyBracket = MkAtomTerm(AtomBeginCurlyBracket); + AtomEndCurlyBracket = AtomAdjust(AtomEndCurlyBracket); TermEndCurlyBracket = MkAtomTerm(AtomEndCurlyBracket); + AtomEmptyBrackets = AtomAdjust(AtomEmptyBrackets); TermEmptyBrackets = MkAtomTerm(AtomEmptyBrackets); + AtomEmptySquareBrackets = AtomAdjust(AtomEmptySquareBrackets); TermEmptySquareBrackets = MkAtomTerm(AtomEmptySquareBrackets); + AtomAsserta = AtomAdjust(AtomAsserta); TermAsserta = MkAtomTerm(AtomAsserta); + AtomAssertaStatic = AtomAdjust(AtomAssertaStatic); TermAssertaStatic = MkAtomTerm(AtomAssertaStatic); + AtomAssertz = AtomAdjust(AtomAssertz); TermAssertz = MkAtomTerm(AtomAssertz); + AtomAssertzStatic = AtomAdjust(AtomAssertzStatic); TermAssertzStatic = MkAtomTerm(AtomAssertzStatic); + AtomAt = AtomAdjust(AtomAt); TermAt = MkAtomTerm(AtomAt); + AtomAtom = AtomAdjust(AtomAtom); TermAtom = MkAtomTerm(AtomAtom); + AtomAtomic = AtomAdjust(AtomAtomic); TermAtomic = MkAtomTerm(AtomAtomic); + AtomAtt = AtomAdjust(AtomAtt); TermAtt = MkAtomTerm(AtomAtt); + AtomAtt1 = AtomAdjust(AtomAtt1); TermAtt1 = MkAtomTerm(AtomAtt1); + AtomAttDo = AtomAdjust(AtomAttDo); TermAttDo = MkAtomTerm(AtomAttDo); + AtomAttributes = AtomAdjust(AtomAttributes); TermAttributes = MkAtomTerm(AtomAttributes); + AtomB = AtomAdjust(AtomB); TermB = MkAtomTerm(AtomB); + AtomBatched = AtomAdjust(AtomBatched); TermBatched = MkAtomTerm(AtomBatched); + AtomBetween = AtomAdjust(AtomBetween); TermBetween = MkAtomTerm(AtomBetween); + AtomBinary = AtomAdjust(AtomBinary); TermBinary = MkAtomTerm(AtomBinary); + AtomBigNum = AtomAdjust(AtomBigNum); TermBigNum = MkAtomTerm(AtomBigNum); + AtomBinaryStream = AtomAdjust(AtomBinaryStream); TermBinaryStream = MkAtomTerm(AtomBinaryStream); + AtomBoolean = AtomAdjust(AtomBoolean); TermBoolean = MkAtomTerm(AtomBoolean); + AtomBraces = AtomAdjust(AtomBraces); TermBraces = MkAtomTerm(AtomBraces); + AtomBreak = AtomAdjust(AtomBreak); TermBreak = MkAtomTerm(AtomBreak); + AtomByte = AtomAdjust(AtomByte); TermByte = MkAtomTerm(AtomByte); + AtomCArith = AtomAdjust(AtomCArith); TermCArith = MkAtomTerm(AtomCArith); + AtomCall = AtomAdjust(AtomCall); TermCall = MkAtomTerm(AtomCall); + AtomCallAndRetryCounter = AtomAdjust(AtomCallAndRetryCounter); TermCallAndRetryCounter = MkAtomTerm(AtomCallAndRetryCounter); + AtomCallCounter = AtomAdjust(AtomCallCounter); TermCallCounter = MkAtomTerm(AtomCallCounter); + AtomCallable = AtomAdjust(AtomCallable); TermCallable = MkAtomTerm(AtomCallable); + AtomCatch = AtomAdjust(AtomCatch); TermCatch = MkAtomTerm(AtomCatch); + AtomChangeModule = AtomAdjust(AtomChangeModule); TermChangeModule = MkAtomTerm(AtomChangeModule); + AtomChar = AtomAdjust(AtomChar); TermChar = MkAtomTerm(AtomChar); + AtomCharsio = AtomAdjust(AtomCharsio); TermCharsio = MkAtomTerm(AtomCharsio); + AtomCharacter = AtomAdjust(AtomCharacter); TermCharacter = MkAtomTerm(AtomCharacter); + AtomCharacterCode = AtomAdjust(AtomCharacterCode); TermCharacterCode = MkAtomTerm(AtomCharacterCode); + AtomChars = AtomAdjust(AtomChars); TermChars = MkAtomTerm(AtomChars); + AtomCharset = AtomAdjust(AtomCharset); TermCharset = MkAtomTerm(AtomCharset); + AtomChType = AtomAdjust(AtomChType); TermChType = MkAtomTerm(AtomChType); + AtomCleanCall = AtomAdjust(AtomCleanCall); TermCleanCall = MkAtomTerm(AtomCleanCall); + AtomClose = AtomAdjust(AtomClose); TermClose = MkAtomTerm(AtomClose); + AtomColon = AtomAdjust(AtomColon); TermColon = MkAtomTerm(AtomColon); + AtomCodeSpace = AtomAdjust(AtomCodeSpace); TermCodeSpace = MkAtomTerm(AtomCodeSpace); + AtomCodes = AtomAdjust(AtomCodes); TermCodes = MkAtomTerm(AtomCodes); + AtomCoInductive = AtomAdjust(AtomCoInductive); TermCoInductive = MkAtomTerm(AtomCoInductive); + AtomComma = AtomAdjust(AtomComma); TermComma = MkAtomTerm(AtomComma); + AtomCommentHook = AtomAdjust(AtomCommentHook); TermCommentHook = MkAtomTerm(AtomCommentHook); + AtomCompact = AtomAdjust(AtomCompact); TermCompact = MkAtomTerm(AtomCompact); + AtomCompound = AtomAdjust(AtomCompound); TermCompound = MkAtomTerm(AtomCompound); + AtomConsistencyError = AtomAdjust(AtomConsistencyError); TermConsistencyError = MkAtomTerm(AtomConsistencyError); + AtomConsult = AtomAdjust(AtomConsult); TermConsult = MkAtomTerm(AtomConsult); + AtomConsultOnBoot = AtomAdjust(AtomConsultOnBoot); TermConsultOnBoot = MkAtomTerm(AtomConsultOnBoot); + AtomContext = AtomAdjust(AtomContext); TermContext = MkAtomTerm(AtomContext); + AtomCputime = AtomAdjust(AtomCputime); TermCputime = MkAtomTerm(AtomCputime); + AtomCreate = AtomAdjust(AtomCreate); TermCreate = MkAtomTerm(AtomCreate); + AtomCreep = AtomAdjust(AtomCreep); TermCreep = MkAtomTerm(AtomCreep); + AtomCryptAtoms = AtomAdjust(AtomCryptAtoms); TermCryptAtoms = MkAtomTerm(AtomCryptAtoms); + AtomCurly = AtomAdjust(AtomCurly); TermCurly = MkAtomTerm(AtomCurly); + AtomCsult = AtomAdjust(AtomCsult); TermCsult = MkAtomTerm(AtomCsult); + AtomCurrentModule = AtomAdjust(AtomCurrentModule); TermCurrentModule = MkAtomTerm(AtomCurrentModule); + AtomCut = AtomAdjust(AtomCut); TermCut = MkAtomTerm(AtomCut); + AtomCutBy = AtomAdjust(AtomCutBy); TermCutBy = MkAtomTerm(AtomCutBy); + AtomDAbort = AtomAdjust(AtomDAbort); TermDAbort = MkAtomTerm(AtomDAbort); + AtomDBLoad = AtomAdjust(AtomDBLoad); TermDBLoad = MkAtomTerm(AtomDBLoad); + AtomDBREF = AtomAdjust(AtomDBREF); TermDBREF = MkAtomTerm(AtomDBREF); + AtomDBReference = AtomAdjust(AtomDBReference); TermDBReference = MkAtomTerm(AtomDBReference); + AtomDBTerm = AtomAdjust(AtomDBTerm); TermDBTerm = MkAtomTerm(AtomDBTerm); + AtomDBref = AtomAdjust(AtomDBref); TermDBref = MkAtomTerm(AtomDBref); + AtomDInteger = AtomAdjust(AtomDInteger); TermDInteger = MkAtomTerm(AtomDInteger); + AtomDebugMeta = AtomAdjust(AtomDebugMeta); TermDebugMeta = MkAtomTerm(AtomDebugMeta); + AtomDebuggerInput = AtomAdjust(AtomDebuggerInput); TermDebuggerInput = MkAtomTerm(AtomDebuggerInput); + AtomDec10 = AtomAdjust(AtomDec10); TermDec10 = MkAtomTerm(AtomDec10); + AtomDefault = AtomAdjust(AtomDefault); TermDefault = MkAtomTerm(AtomDefault); + AtomDevNull = AtomAdjust(AtomDevNull); TermDevNull = MkAtomTerm(AtomDevNull); + AtomDiff = AtomAdjust(AtomDiff); TermDiff = MkAtomTerm(AtomDiff); + AtomDirectory = AtomAdjust(AtomDirectory); TermDirectory = MkAtomTerm(AtomDirectory); + AtomDiscontiguous = AtomAdjust(AtomDiscontiguous); TermDiscontiguous = MkAtomTerm(AtomDiscontiguous); + AtomDiscontiguousWarnings = AtomAdjust(AtomDiscontiguousWarnings); TermDiscontiguousWarnings = MkAtomTerm(AtomDiscontiguousWarnings); + AtomDollar = AtomAdjust(AtomDollar); TermDollar = MkAtomTerm(AtomDollar); + AtomDoLogUpdClause = AtomAdjust(AtomDoLogUpdClause); TermDoLogUpdClause = MkAtomTerm(AtomDoLogUpdClause); + AtomDoLogUpdClause0 = AtomAdjust(AtomDoLogUpdClause0); TermDoLogUpdClause0 = MkAtomTerm(AtomDoLogUpdClause0); + AtomDoLogUpdClauseErase = AtomAdjust(AtomDoLogUpdClauseErase); TermDoLogUpdClauseErase = MkAtomTerm(AtomDoLogUpdClauseErase); + AtomDollarU = AtomAdjust(AtomDollarU); TermDollarU = MkAtomTerm(AtomDollarU); + AtomDollarUndef = AtomAdjust(AtomDollarUndef); TermDollarUndef = MkAtomTerm(AtomDollarUndef); + AtomDomainError = AtomAdjust(AtomDomainError); TermDomainError = MkAtomTerm(AtomDomainError); + AtomDoStaticClause = AtomAdjust(AtomDoStaticClause); TermDoStaticClause = MkAtomTerm(AtomDoStaticClause); + AtomDots = AtomAdjust(AtomDots); TermDots = MkAtomTerm(AtomDots); + AtomDOUBLE = AtomAdjust(AtomDOUBLE); TermDOUBLE = MkAtomTerm(AtomDOUBLE); + AtomDoubleSlash = AtomAdjust(AtomDoubleSlash); TermDoubleSlash = MkAtomTerm(AtomDoubleSlash); + AtomE = AtomAdjust(AtomE); TermE = MkAtomTerm(AtomE); + AtomEOFBeforeEOT = AtomAdjust(AtomEOFBeforeEOT); TermEOFBeforeEOT = MkAtomTerm(AtomEOFBeforeEOT); + AtomEQ = AtomAdjust(AtomEQ); TermEQ = MkAtomTerm(AtomEQ); + AtomEmptyAtom = AtomAdjust(AtomEmptyAtom); TermEmptyAtom = MkAtomTerm(AtomEmptyAtom); + AtomEncoding = AtomAdjust(AtomEncoding); TermEncoding = MkAtomTerm(AtomEncoding); + AtomEndOfStream = AtomAdjust(AtomEndOfStream); TermEndOfStream = MkAtomTerm(AtomEndOfStream); + AtomEof = AtomAdjust(AtomEof); TermEof = MkAtomTerm(AtomEof); + AtomEOfCode = AtomAdjust(AtomEOfCode); TermEOfCode = MkAtomTerm(AtomEOfCode); + AtomEq = AtomAdjust(AtomEq); TermEq = MkAtomTerm(AtomEq); + AtomError = AtomAdjust(AtomError); TermError = MkAtomTerm(AtomError); + AtomException = AtomAdjust(AtomException); TermException = MkAtomTerm(AtomException); + AtomExtensions = AtomAdjust(AtomExtensions); TermExtensions = MkAtomTerm(AtomExtensions); + AtomEvaluable = AtomAdjust(AtomEvaluable); TermEvaluable = MkAtomTerm(AtomEvaluable); + AtomEvaluationError = AtomAdjust(AtomEvaluationError); TermEvaluationError = MkAtomTerm(AtomEvaluationError); + AtomExecutable = AtomAdjust(AtomExecutable); TermExecutable = MkAtomTerm(AtomExecutable); + AtomExecute = AtomAdjust(AtomExecute); TermExecute = MkAtomTerm(AtomExecute); + AtomExecAnswers = AtomAdjust(AtomExecAnswers); TermExecAnswers = MkAtomTerm(AtomExecAnswers); + AtomExecuteInMod = AtomAdjust(AtomExecuteInMod); TermExecuteInMod = MkAtomTerm(AtomExecuteInMod); + AtomExecuteWithin = AtomAdjust(AtomExecuteWithin); TermExecuteWithin = MkAtomTerm(AtomExecuteWithin); + AtomExecuteWoMod = AtomAdjust(AtomExecuteWoMod); TermExecuteWoMod = MkAtomTerm(AtomExecuteWoMod); + AtomExist = AtomAdjust(AtomExist); TermExist = MkAtomTerm(AtomExist); + AtomExists = AtomAdjust(AtomExists); TermExists = MkAtomTerm(AtomExists); + AtomExit = AtomAdjust(AtomExit); TermExit = MkAtomTerm(AtomExit); + AtomExistenceError = AtomAdjust(AtomExistenceError); TermExistenceError = MkAtomTerm(AtomExistenceError); + AtomExoClause = AtomAdjust(AtomExoClause); TermExoClause = MkAtomTerm(AtomExoClause); + AtomExpectedNumber = AtomAdjust(AtomExpectedNumber); TermExpectedNumber = MkAtomTerm(AtomExpectedNumber); + AtomExpand = AtomAdjust(AtomExpand); TermExpand = MkAtomTerm(AtomExpand); + AtomExtendFileSearchPath = AtomAdjust(AtomExtendFileSearchPath); TermExtendFileSearchPath = MkAtomTerm(AtomExtendFileSearchPath); + AtomExtendsions = AtomAdjust(AtomExtendsions); TermExtendsions = MkAtomTerm(AtomExtendsions); + AtomFB = AtomAdjust(AtomFB); TermFB = MkAtomTerm(AtomFB); + AtomFail = AtomAdjust(AtomFail); TermFail = MkAtomTerm(AtomFail); + AtomFalse = AtomAdjust(AtomFalse); TermFalse = MkAtomTerm(AtomFalse); + AtomFast = AtomAdjust(AtomFast); TermFast = MkAtomTerm(AtomFast); + AtomFastFail = AtomAdjust(AtomFastFail); TermFastFail = MkAtomTerm(AtomFastFail); + AtomFileErrors = AtomAdjust(AtomFileErrors); TermFileErrors = MkAtomTerm(AtomFileErrors); + AtomFileerrors = AtomAdjust(AtomFileerrors); TermFileerrors = MkAtomTerm(AtomFileerrors); + AtomFileType = AtomAdjust(AtomFileType); TermFileType = MkAtomTerm(AtomFileType); + AtomFirst = AtomAdjust(AtomFirst); TermFirst = MkAtomTerm(AtomFirst); + AtomFloat = AtomAdjust(AtomFloat); TermFloat = MkAtomTerm(AtomFloat); + AtomFloatFormat = AtomAdjust(AtomFloatFormat); TermFloatFormat = MkAtomTerm(AtomFloatFormat); + AtomFloatOverflow = AtomAdjust(AtomFloatOverflow); TermFloatOverflow = MkAtomTerm(AtomFloatOverflow); + AtomFloatUnderflow = AtomAdjust(AtomFloatUnderflow); TermFloatUnderflow = MkAtomTerm(AtomFloatUnderflow); + AtomFormat = AtomAdjust(AtomFormat); TermFormat = MkAtomTerm(AtomFormat); + AtomFormatAt = AtomAdjust(AtomFormatAt); TermFormatAt = MkAtomTerm(AtomFormatAt); + AtomFull = AtomAdjust(AtomFull); TermFull = MkAtomTerm(AtomFull); + AtomFunctor = AtomAdjust(AtomFunctor); TermFunctor = MkAtomTerm(AtomFunctor); + AtomGT = AtomAdjust(AtomGT); TermGT = MkAtomTerm(AtomGT); + AtomGVar = AtomAdjust(AtomGVar); TermGVar = MkAtomTerm(AtomGVar); + AtomGc = AtomAdjust(AtomGc); TermGc = MkAtomTerm(AtomGc); + AtomGcMargin = AtomAdjust(AtomGcMargin); TermGcMargin = MkAtomTerm(AtomGcMargin); + AtomGcTrace = AtomAdjust(AtomGcTrace); TermGcTrace = MkAtomTerm(AtomGcTrace); + AtomGcVerbose = AtomAdjust(AtomGcVerbose); TermGcVerbose = MkAtomTerm(AtomGcVerbose); + AtomGcVeryVerbose = AtomAdjust(AtomGcVeryVerbose); TermGcVeryVerbose = MkAtomTerm(AtomGcVeryVerbose); + AtomGeneratePredInfo = AtomAdjust(AtomGeneratePredInfo); TermGeneratePredInfo = MkAtomTerm(AtomGeneratePredInfo); + AtomGetwork = AtomAdjust(AtomGetwork); TermGetwork = MkAtomTerm(AtomGetwork); + AtomGetworkSeq = AtomAdjust(AtomGetworkSeq); TermGetworkSeq = MkAtomTerm(AtomGetworkSeq); + AtomGlob = AtomAdjust(AtomGlob); TermGlob = MkAtomTerm(AtomGlob); + AtomGlobal = AtomAdjust(AtomGlobal); TermGlobal = MkAtomTerm(AtomGlobal); + AtomGlobalSp = AtomAdjust(AtomGlobalSp); TermGlobalSp = MkAtomTerm(AtomGlobalSp); + AtomGlobalTrie = AtomAdjust(AtomGlobalTrie); TermGlobalTrie = MkAtomTerm(AtomGlobalTrie); + AtomGoalExpansion = AtomAdjust(AtomGoalExpansion); TermGoalExpansion = MkAtomTerm(AtomGoalExpansion); + AtomHat = AtomAdjust(AtomHat); TermHat = MkAtomTerm(AtomHat); + AtomHERE = AtomAdjust(AtomHERE); TermHERE = MkAtomTerm(AtomHERE); + AtomHandleThrow = AtomAdjust(AtomHandleThrow); TermHandleThrow = MkAtomTerm(AtomHandleThrow); + AtomHeap = AtomAdjust(AtomHeap); TermHeap = MkAtomTerm(AtomHeap); + AtomHeapUsed = AtomAdjust(AtomHeapUsed); TermHeapUsed = MkAtomTerm(AtomHeapUsed); + AtomHugeInt = AtomAdjust(AtomHugeInt); TermHugeInt = MkAtomTerm(AtomHugeInt); + AtomIDB = AtomAdjust(AtomIDB); TermIDB = MkAtomTerm(AtomIDB); + AtomIOMode = AtomAdjust(AtomIOMode); TermIOMode = MkAtomTerm(AtomIOMode); + AtomI = AtomAdjust(AtomI); TermI = MkAtomTerm(AtomI); + AtomId = AtomAdjust(AtomId); TermId = MkAtomTerm(AtomId); + AtomIgnore = AtomAdjust(AtomIgnore); TermIgnore = MkAtomTerm(AtomIgnore); + AtomInf = AtomAdjust(AtomInf); TermInf = MkAtomTerm(AtomInf); + AtomInfinity = AtomAdjust(AtomInfinity); TermInfinity = MkAtomTerm(AtomInfinity); + AtomInfo = AtomAdjust(AtomInfo); TermInfo = MkAtomTerm(AtomInfo); + AtomInitGoal = AtomAdjust(AtomInitGoal); TermInitGoal = MkAtomTerm(AtomInitGoal); + AtomInitProlog = AtomAdjust(AtomInitProlog); TermInitProlog = MkAtomTerm(AtomInitProlog); + AtomInStackExpansion = AtomAdjust(AtomInStackExpansion); TermInStackExpansion = MkAtomTerm(AtomInStackExpansion); + AtomInput = AtomAdjust(AtomInput); TermInput = MkAtomTerm(AtomInput); + AtomInstantiationError = AtomAdjust(AtomInstantiationError); TermInstantiationError = MkAtomTerm(AtomInstantiationError); + AtomInt = AtomAdjust(AtomInt); TermInt = MkAtomTerm(AtomInt); + AtomIntOverflow = AtomAdjust(AtomIntOverflow); TermIntOverflow = MkAtomTerm(AtomIntOverflow); + AtomInteger = AtomAdjust(AtomInteger); TermInteger = MkAtomTerm(AtomInteger); + AtomInternalCompilerError = AtomAdjust(AtomInternalCompilerError); TermInternalCompilerError = MkAtomTerm(AtomInternalCompilerError); + AtomIs = AtomAdjust(AtomIs); TermIs = MkAtomTerm(AtomIs); + AtomJ = AtomAdjust(AtomJ); TermJ = MkAtomTerm(AtomJ); + Atoml = AtomAdjust(Atoml); Terml = MkAtomTerm(Atoml); + AtomKey = AtomAdjust(AtomKey); TermKey = MkAtomTerm(AtomKey); + AtomLDLibraryPath = AtomAdjust(AtomLDLibraryPath); TermLDLibraryPath = MkAtomTerm(AtomLDLibraryPath); + AtomLONGINT = AtomAdjust(AtomLONGINT); TermLONGINT = MkAtomTerm(AtomLONGINT); + AtomLOOP = AtomAdjust(AtomLOOP); TermLOOP = MkAtomTerm(AtomLOOP); + AtomLoopStream = AtomAdjust(AtomLoopStream); TermLoopStream = MkAtomTerm(AtomLoopStream); + AtomLT = AtomAdjust(AtomLT); TermLT = MkAtomTerm(AtomLT); + AtomLastExecuteWithin = AtomAdjust(AtomLastExecuteWithin); TermLastExecuteWithin = MkAtomTerm(AtomLastExecuteWithin); + AtomLeash = AtomAdjust(AtomLeash); TermLeash = MkAtomTerm(AtomLeash); + AtomLeast = AtomAdjust(AtomLeast); TermLeast = MkAtomTerm(AtomLeast); + AtomLength = AtomAdjust(AtomLength); TermLength = MkAtomTerm(AtomLength); + AtomList = AtomAdjust(AtomList); TermList = MkAtomTerm(AtomList); + AtomLine = AtomAdjust(AtomLine); TermLine = MkAtomTerm(AtomLine); + AtomLive = AtomAdjust(AtomLive); TermLive = MkAtomTerm(AtomLive); + AtomLoadAnswers = AtomAdjust(AtomLoadAnswers); TermLoadAnswers = MkAtomTerm(AtomLoadAnswers); + AtomLocal = AtomAdjust(AtomLocal); TermLocal = MkAtomTerm(AtomLocal); + AtomLocalSp = AtomAdjust(AtomLocalSp); TermLocalSp = MkAtomTerm(AtomLocalSp); + AtomLocalTrie = AtomAdjust(AtomLocalTrie); TermLocalTrie = MkAtomTerm(AtomLocalTrie); + AtomMax = AtomAdjust(AtomMax); TermMax = MkAtomTerm(AtomMax); + AtomMaximum = AtomAdjust(AtomMaximum); TermMaximum = MkAtomTerm(AtomMaximum); + AtomMaxArity = AtomAdjust(AtomMaxArity); TermMaxArity = MkAtomTerm(AtomMaxArity); + AtomMaxFiles = AtomAdjust(AtomMaxFiles); TermMaxFiles = MkAtomTerm(AtomMaxFiles); + AtomMegaClause = AtomAdjust(AtomMegaClause); TermMegaClause = MkAtomTerm(AtomMegaClause); + AtomMetaCall = AtomAdjust(AtomMetaCall); TermMetaCall = MkAtomTerm(AtomMetaCall); + AtomMfClause = AtomAdjust(AtomMfClause); TermMfClause = MkAtomTerm(AtomMfClause); + AtomMin = AtomAdjust(AtomMin); TermMin = MkAtomTerm(AtomMin); + AtomMinimum = AtomAdjust(AtomMinimum); TermMinimum = MkAtomTerm(AtomMinimum); + AtomMinus = AtomAdjust(AtomMinus); TermMinus = MkAtomTerm(AtomMinus); + AtomModify = AtomAdjust(AtomModify); TermModify = MkAtomTerm(AtomModify); + AtomModule = AtomAdjust(AtomModule); TermModule = MkAtomTerm(AtomModule); + AtomMost = AtomAdjust(AtomMost); TermMost = MkAtomTerm(AtomMost); + AtomMulti = AtomAdjust(AtomMulti); TermMulti = MkAtomTerm(AtomMulti); + AtomMultiFile = AtomAdjust(AtomMultiFile); TermMultiFile = MkAtomTerm(AtomMultiFile); + AtomMultiple = AtomAdjust(AtomMultiple); TermMultiple = MkAtomTerm(AtomMultiple); + AtomMutable = AtomAdjust(AtomMutable); TermMutable = MkAtomTerm(AtomMutable); + AtomMutableVariable = AtomAdjust(AtomMutableVariable); TermMutableVariable = MkAtomTerm(AtomMutableVariable); + AtomMutex = AtomAdjust(AtomMutex); TermMutex = MkAtomTerm(AtomMutex); + AtomMyddasDB = AtomAdjust(AtomMyddasDB); TermMyddasDB = MkAtomTerm(AtomMyddasDB); + AtomMyddasGoal = AtomAdjust(AtomMyddasGoal); TermMyddasGoal = MkAtomTerm(AtomMyddasGoal); + AtomMyddasHost = AtomAdjust(AtomMyddasHost); TermMyddasHost = MkAtomTerm(AtomMyddasHost); + AtomMyddasPass = AtomAdjust(AtomMyddasPass); TermMyddasPass = MkAtomTerm(AtomMyddasPass); + AtomMyddasUser = AtomAdjust(AtomMyddasUser); TermMyddasUser = MkAtomTerm(AtomMyddasUser); + AtomMyddasVersionName = AtomAdjust(AtomMyddasVersionName); TermMyddasVersionName = MkAtomTerm(AtomMyddasVersionName); + AtomNan = AtomAdjust(AtomNan); TermNan = MkAtomTerm(AtomNan); + AtomNb = AtomAdjust(AtomNb); TermNb = MkAtomTerm(AtomNb); + AtomNbTerm = AtomAdjust(AtomNbTerm); TermNbTerm = MkAtomTerm(AtomNbTerm); + AtomNew = AtomAdjust(AtomNew); TermNew = MkAtomTerm(AtomNew); + AtomNewLine = AtomAdjust(AtomNewLine); TermNewLine = MkAtomTerm(AtomNewLine); + AtomNl = AtomAdjust(AtomNl); TermNl = MkAtomTerm(AtomNl); + AtomNoEffect = AtomAdjust(AtomNoEffect); TermNoEffect = MkAtomTerm(AtomNoEffect); + AtomNoMemory = AtomAdjust(AtomNoMemory); TermNoMemory = MkAtomTerm(AtomNoMemory); + AtomNone = AtomAdjust(AtomNone); TermNone = MkAtomTerm(AtomNone); + AtomNonEmptyList = AtomAdjust(AtomNonEmptyList); TermNonEmptyList = MkAtomTerm(AtomNonEmptyList); + AtomNot = AtomAdjust(AtomNot); TermNot = MkAtomTerm(AtomNot); + AtomNotImplemented = AtomAdjust(AtomNotImplemented); TermNotImplemented = MkAtomTerm(AtomNotImplemented); + AtomNotLessThanZero = AtomAdjust(AtomNotLessThanZero); TermNotLessThanZero = MkAtomTerm(AtomNotLessThanZero); + AtomNotNewline = AtomAdjust(AtomNotNewline); TermNotNewline = MkAtomTerm(AtomNotNewline); + AtomNotZero = AtomAdjust(AtomNotZero); TermNotZero = MkAtomTerm(AtomNotZero); + AtomNumber = AtomAdjust(AtomNumber); TermNumber = MkAtomTerm(AtomNumber); + AtomObj = AtomAdjust(AtomObj); TermObj = MkAtomTerm(AtomObj); + AtomOff = AtomAdjust(AtomOff); TermOff = MkAtomTerm(AtomOff); + AtomOffline = AtomAdjust(AtomOffline); TermOffline = MkAtomTerm(AtomOffline); + AtomOn = AtomAdjust(AtomOn); TermOn = MkAtomTerm(AtomOn); + AtomOnline = AtomAdjust(AtomOnline); TermOnline = MkAtomTerm(AtomOnline); + AtomOpen = AtomAdjust(AtomOpen); TermOpen = MkAtomTerm(AtomOpen); + AtomOperatingSystemError = AtomAdjust(AtomOperatingSystemError); TermOperatingSystemError = MkAtomTerm(AtomOperatingSystemError); + AtomOperatingSystemSupport = AtomAdjust(AtomOperatingSystemSupport); TermOperatingSystemSupport = MkAtomTerm(AtomOperatingSystemSupport); + AtomOperator = AtomAdjust(AtomOperator); TermOperator = MkAtomTerm(AtomOperator); + AtomOperatorPriority = AtomAdjust(AtomOperatorPriority); TermOperatorPriority = MkAtomTerm(AtomOperatorPriority); + AtomOperatorSpecifier = AtomAdjust(AtomOperatorSpecifier); TermOperatorSpecifier = MkAtomTerm(AtomOperatorSpecifier); + AtomOpt = AtomAdjust(AtomOpt); TermOpt = MkAtomTerm(AtomOpt); + AtomOtherwise = AtomAdjust(AtomOtherwise); TermOtherwise = MkAtomTerm(AtomOtherwise); + AtomOutOfAttvarsError = AtomAdjust(AtomOutOfAttvarsError); TermOutOfAttvarsError = MkAtomTerm(AtomOutOfAttvarsError); + AtomOutOfAuxspaceError = AtomAdjust(AtomOutOfAuxspaceError); TermOutOfAuxspaceError = MkAtomTerm(AtomOutOfAuxspaceError); + AtomOutOfHeapError = AtomAdjust(AtomOutOfHeapError); TermOutOfHeapError = MkAtomTerm(AtomOutOfHeapError); + AtomOutOfRange = AtomAdjust(AtomOutOfRange); TermOutOfRange = MkAtomTerm(AtomOutOfRange); + AtomOutOfStackError = AtomAdjust(AtomOutOfStackError); TermOutOfStackError = MkAtomTerm(AtomOutOfStackError); + AtomOutOfTrailError = AtomAdjust(AtomOutOfTrailError); TermOutOfTrailError = MkAtomTerm(AtomOutOfTrailError); + AtomOutput = AtomAdjust(AtomOutput); TermOutput = MkAtomTerm(AtomOutput); + AtomParameter = AtomAdjust(AtomParameter); TermParameter = MkAtomTerm(AtomParameter); + AtomPrologCommonsDir = AtomAdjust(AtomPrologCommonsDir); TermPrologCommonsDir = MkAtomTerm(AtomPrologCommonsDir); + AtomPast = AtomAdjust(AtomPast); TermPast = MkAtomTerm(AtomPast); + AtomPastEndOfStream = AtomAdjust(AtomPastEndOfStream); TermPastEndOfStream = MkAtomTerm(AtomPastEndOfStream); + AtomPermissionError = AtomAdjust(AtomPermissionError); TermPermissionError = MkAtomTerm(AtomPermissionError); + AtomPi = AtomAdjust(AtomPi); TermPi = MkAtomTerm(AtomPi); + AtomPipe = AtomAdjust(AtomPipe); TermPipe = MkAtomTerm(AtomPipe); + AtomPriority = AtomAdjust(AtomPriority); TermPriority = MkAtomTerm(AtomPriority); + AtomPlus = AtomAdjust(AtomPlus); TermPlus = MkAtomTerm(AtomPlus); + AtomPointer = AtomAdjust(AtomPointer); TermPointer = MkAtomTerm(AtomPointer); + AtomPortray = AtomAdjust(AtomPortray); TermPortray = MkAtomTerm(AtomPortray); + AtomPredicateIndicator = AtomAdjust(AtomPredicateIndicator); TermPredicateIndicator = MkAtomTerm(AtomPredicateIndicator); + AtomPrimitive = AtomAdjust(AtomPrimitive); TermPrimitive = MkAtomTerm(AtomPrimitive); + AtomPrintMessage = AtomAdjust(AtomPrintMessage); TermPrintMessage = MkAtomTerm(AtomPrintMessage); + AtomPrivateProcedure = AtomAdjust(AtomPrivateProcedure); TermPrivateProcedure = MkAtomTerm(AtomPrivateProcedure); + AtomProcedure = AtomAdjust(AtomProcedure); TermProcedure = MkAtomTerm(AtomProcedure); + AtomProfile = AtomAdjust(AtomProfile); TermProfile = MkAtomTerm(AtomProfile); + AtomProlog = AtomAdjust(AtomProlog); TermProlog = MkAtomTerm(AtomProlog); + AtomProtectStack = AtomAdjust(AtomProtectStack); TermProtectStack = MkAtomTerm(AtomProtectStack); + AtomQly = AtomAdjust(AtomQly); TermQly = MkAtomTerm(AtomQly); + AtomQuery = AtomAdjust(AtomQuery); TermQuery = MkAtomTerm(AtomQuery); + AtomQueue = AtomAdjust(AtomQueue); TermQueue = MkAtomTerm(AtomQueue); + AtomQuiet = AtomAdjust(AtomQuiet); TermQuiet = MkAtomTerm(AtomQuiet); + AtomRadix = AtomAdjust(AtomRadix); TermRadix = MkAtomTerm(AtomRadix); + AtomRandom = AtomAdjust(AtomRandom); TermRandom = MkAtomTerm(AtomRandom); + AtomRange = AtomAdjust(AtomRange); TermRange = MkAtomTerm(AtomRange); + AtomRDiv = AtomAdjust(AtomRDiv); TermRDiv = MkAtomTerm(AtomRDiv); + AtomRead = AtomAdjust(AtomRead); TermRead = MkAtomTerm(AtomRead); + AtomReadOnly = AtomAdjust(AtomReadOnly); TermReadOnly = MkAtomTerm(AtomReadOnly); + AtomReadWrite = AtomAdjust(AtomReadWrite); TermReadWrite = MkAtomTerm(AtomReadWrite); + AtomReadutil = AtomAdjust(AtomReadutil); TermReadutil = MkAtomTerm(AtomReadutil); + AtomReconsult = AtomAdjust(AtomReconsult); TermReconsult = MkAtomTerm(AtomReconsult); + AtomRecordedP = AtomAdjust(AtomRecordedP); TermRecordedP = MkAtomTerm(AtomRecordedP); + AtomRecordedWithKey = AtomAdjust(AtomRecordedWithKey); TermRecordedWithKey = MkAtomTerm(AtomRecordedWithKey); + AtomRedefineWarnings = AtomAdjust(AtomRedefineWarnings); TermRedefineWarnings = MkAtomTerm(AtomRedefineWarnings); + AtomRedoFreeze = AtomAdjust(AtomRedoFreeze); TermRedoFreeze = MkAtomTerm(AtomRedoFreeze); + AtomRefoundVar = AtomAdjust(AtomRefoundVar); TermRefoundVar = MkAtomTerm(AtomRefoundVar); + AtomRelativeTo = AtomAdjust(AtomRelativeTo); TermRelativeTo = MkAtomTerm(AtomRelativeTo); + AtomRepeat = AtomAdjust(AtomRepeat); TermRepeat = MkAtomTerm(AtomRepeat); + AtomRepeatSpace = AtomAdjust(AtomRepeatSpace); TermRepeatSpace = MkAtomTerm(AtomRepeatSpace); + AtomReposition = AtomAdjust(AtomReposition); TermReposition = MkAtomTerm(AtomReposition); + AtomRepresentationError = AtomAdjust(AtomRepresentationError); TermRepresentationError = MkAtomTerm(AtomRepresentationError); + AtomReset = AtomAdjust(AtomReset); TermReset = MkAtomTerm(AtomReset); + AtomResize = AtomAdjust(AtomResize); TermResize = MkAtomTerm(AtomResize); + AtomResourceError = AtomAdjust(AtomResourceError); TermResourceError = MkAtomTerm(AtomResourceError); + AtomRestoreRegs = AtomAdjust(AtomRestoreRegs); TermRestoreRegs = MkAtomTerm(AtomRestoreRegs); + AtomRetry = AtomAdjust(AtomRetry); TermRetry = MkAtomTerm(AtomRetry); + AtomRetryCounter = AtomAdjust(AtomRetryCounter); TermRetryCounter = MkAtomTerm(AtomRetryCounter); + AtomRTree = AtomAdjust(AtomRTree); TermRTree = MkAtomTerm(AtomRTree); + AtomSafe = AtomAdjust(AtomSafe); TermSafe = MkAtomTerm(AtomSafe); + AtomSafeCallCleanup = AtomAdjust(AtomSafeCallCleanup); TermSafeCallCleanup = MkAtomTerm(AtomSafeCallCleanup); + AtomSame = AtomAdjust(AtomSame); TermSame = MkAtomTerm(AtomSame); + AtomSemic = AtomAdjust(AtomSemic); TermSemic = MkAtomTerm(AtomSemic); + AtomShiftCountOverflow = AtomAdjust(AtomShiftCountOverflow); TermShiftCountOverflow = MkAtomTerm(AtomShiftCountOverflow); + AtomSigAlarm = AtomAdjust(AtomSigAlarm); TermSigAlarm = MkAtomTerm(AtomSigAlarm); + AtomSigBreak = AtomAdjust(AtomSigBreak); TermSigBreak = MkAtomTerm(AtomSigBreak); + AtomSigCreep = AtomAdjust(AtomSigCreep); TermSigCreep = MkAtomTerm(AtomSigCreep); + AtomSigDebug = AtomAdjust(AtomSigDebug); TermSigDebug = MkAtomTerm(AtomSigDebug); + AtomSigDelayCreep = AtomAdjust(AtomSigDelayCreep); TermSigDelayCreep = MkAtomTerm(AtomSigDelayCreep); + AtomSigFPE = AtomAdjust(AtomSigFPE); TermSigFPE = MkAtomTerm(AtomSigFPE); + AtomSigHup = AtomAdjust(AtomSigHup); TermSigHup = MkAtomTerm(AtomSigHup); + AtomSigInt = AtomAdjust(AtomSigInt); TermSigInt = MkAtomTerm(AtomSigInt); + AtomSigIti = AtomAdjust(AtomSigIti); TermSigIti = MkAtomTerm(AtomSigIti); + AtomSigPending = AtomAdjust(AtomSigPending); TermSigPending = MkAtomTerm(AtomSigPending); + AtomSigPipe = AtomAdjust(AtomSigPipe); TermSigPipe = MkAtomTerm(AtomSigPipe); + AtomSigStackDump = AtomAdjust(AtomSigStackDump); TermSigStackDump = MkAtomTerm(AtomSigStackDump); + AtomSigStatistics = AtomAdjust(AtomSigStatistics); TermSigStatistics = MkAtomTerm(AtomSigStatistics); + AtomSigTrace = AtomAdjust(AtomSigTrace); TermSigTrace = MkAtomTerm(AtomSigTrace); + AtomSigUsr1 = AtomAdjust(AtomSigUsr1); TermSigUsr1 = MkAtomTerm(AtomSigUsr1); + AtomSigUsr2 = AtomAdjust(AtomSigUsr2); TermSigUsr2 = MkAtomTerm(AtomSigUsr2); + AtomSigVTAlarm = AtomAdjust(AtomSigVTAlarm); TermSigVTAlarm = MkAtomTerm(AtomSigVTAlarm); + AtomSigWakeUp = AtomAdjust(AtomSigWakeUp); TermSigWakeUp = MkAtomTerm(AtomSigWakeUp); + AtomSilent = AtomAdjust(AtomSilent); TermSilent = MkAtomTerm(AtomSilent); + AtomSingle = AtomAdjust(AtomSingle); TermSingle = MkAtomTerm(AtomSingle); + AtomSingleVarWarnings = AtomAdjust(AtomSingleVarWarnings); TermSingleVarWarnings = MkAtomTerm(AtomSingleVarWarnings); + AtomSingleton = AtomAdjust(AtomSingleton); TermSingleton = MkAtomTerm(AtomSingleton); + AtomSlash = AtomAdjust(AtomSlash); TermSlash = MkAtomTerm(AtomSlash); + AtomSocket = AtomAdjust(AtomSocket); TermSocket = MkAtomTerm(AtomSocket); + AtomSolutions = AtomAdjust(AtomSolutions); TermSolutions = MkAtomTerm(AtomSolutions); + AtomSource = AtomAdjust(AtomSource); TermSource = MkAtomTerm(AtomSource); + AtomSourceSink = AtomAdjust(AtomSourceSink); TermSourceSink = MkAtomTerm(AtomSourceSink); + AtomSpy = AtomAdjust(AtomSpy); TermSpy = MkAtomTerm(AtomSpy); + AtomStack = AtomAdjust(AtomStack); TermStack = MkAtomTerm(AtomStack); + AtomStackFree = AtomAdjust(AtomStackFree); TermStackFree = MkAtomTerm(AtomStackFree); + AtomStartupSavedState = AtomAdjust(AtomStartupSavedState); TermStartupSavedState = MkAtomTerm(AtomStartupSavedState); + AtomStaticClause = AtomAdjust(AtomStaticClause); TermStaticClause = MkAtomTerm(AtomStaticClause); + AtomStaticProcedure = AtomAdjust(AtomStaticProcedure); TermStaticProcedure = MkAtomTerm(AtomStaticProcedure); + AtomStream = AtomAdjust(AtomStream); TermStream = MkAtomTerm(AtomStream); + AtomSWIStream = AtomAdjust(AtomSWIStream); TermSWIStream = MkAtomTerm(AtomSWIStream); + AtomVStream = AtomAdjust(AtomVStream); TermVStream = MkAtomTerm(AtomVStream); + AtomStreams = AtomAdjust(AtomStreams); TermStreams = MkAtomTerm(AtomStreams); + AtomStreamOrAlias = AtomAdjust(AtomStreamOrAlias); TermStreamOrAlias = MkAtomTerm(AtomStreamOrAlias); + AtomStreamPos = AtomAdjust(AtomStreamPos); TermStreamPos = MkAtomTerm(AtomStreamPos); + AtomStreamPosition = AtomAdjust(AtomStreamPosition); TermStreamPosition = MkAtomTerm(AtomStreamPosition); + AtomString = AtomAdjust(AtomString); TermString = MkAtomTerm(AtomString); + AtomStyleCheck = AtomAdjust(AtomStyleCheck); TermStyleCheck = MkAtomTerm(AtomStyleCheck); + AtomSTRING = AtomAdjust(AtomSTRING); TermSTRING = MkAtomTerm(AtomSTRING); + AtomSwi = AtomAdjust(AtomSwi); TermSwi = MkAtomTerm(AtomSwi); + AtomSymbolChar = AtomAdjust(AtomSymbolChar); TermSymbolChar = MkAtomTerm(AtomSymbolChar); + AtomSyntaxError = AtomAdjust(AtomSyntaxError); TermSyntaxError = MkAtomTerm(AtomSyntaxError); + AtomSyntaxErrors = AtomAdjust(AtomSyntaxErrors); TermSyntaxErrors = MkAtomTerm(AtomSyntaxErrors); + AtomSyntaxErrorHandler = AtomAdjust(AtomSyntaxErrorHandler); TermSyntaxErrorHandler = MkAtomTerm(AtomSyntaxErrorHandler); + AtomSystem = AtomAdjust(AtomSystem); TermSystem = MkAtomTerm(AtomSystem); + AtomSystemError = AtomAdjust(AtomSystemError); TermSystemError = MkAtomTerm(AtomSystemError); + AtomSystemLibraryDir = AtomAdjust(AtomSystemLibraryDir); TermSystemLibraryDir = MkAtomTerm(AtomSystemLibraryDir); + AtomT = AtomAdjust(AtomT); TermT = MkAtomTerm(AtomT); + AtomTerm = AtomAdjust(AtomTerm); TermTerm = MkAtomTerm(AtomTerm); + AtomTermExpansion = AtomAdjust(AtomTermExpansion); TermTermExpansion = MkAtomTerm(AtomTermExpansion); + AtomTerms = AtomAdjust(AtomTerms); TermTerms = MkAtomTerm(AtomTerms); + AtomText = AtomAdjust(AtomText); TermText = MkAtomTerm(AtomText); + AtomTextStream = AtomAdjust(AtomTextStream); TermTextStream = MkAtomTerm(AtomTextStream); + AtomThread = AtomAdjust(AtomThread); TermThread = MkAtomTerm(AtomThread); + AtomThreads = AtomAdjust(AtomThreads); TermThreads = MkAtomTerm(AtomThreads); + AtomThrow = AtomAdjust(AtomThrow); TermThrow = MkAtomTerm(AtomThrow); + AtomTimeOutSpec = AtomAdjust(AtomTimeOutSpec); TermTimeOutSpec = MkAtomTerm(AtomTimeOutSpec); + AtomTimeoutError = AtomAdjust(AtomTimeoutError); TermTimeoutError = MkAtomTerm(AtomTimeoutError); + AtomTopLevelGoal = AtomAdjust(AtomTopLevelGoal); TermTopLevelGoal = MkAtomTerm(AtomTopLevelGoal); + AtomTopThreadGoal = AtomAdjust(AtomTopThreadGoal); TermTopThreadGoal = MkAtomTerm(AtomTopThreadGoal); + AtomTraceMetaCall = AtomAdjust(AtomTraceMetaCall); TermTraceMetaCall = MkAtomTerm(AtomTraceMetaCall); + AtomTrail = AtomAdjust(AtomTrail); + AtomTrue = AtomAdjust(AtomTrue); TermTrue = MkAtomTerm(AtomTrue); + AtomTty = AtomAdjust(AtomTty); TermTty = MkAtomTerm(AtomTty); + AtomTtys = AtomAdjust(AtomTtys); TermTtys = MkAtomTerm(AtomTtys); + AtomTuple = AtomAdjust(AtomTuple); TermTuple = MkAtomTerm(AtomTuple); + AtomTxt = AtomAdjust(AtomTxt); TermTxt = MkAtomTerm(AtomTxt); + AtomTypeError = AtomAdjust(AtomTypeError); TermTypeError = MkAtomTerm(AtomTypeError); + AtomUndefined = AtomAdjust(AtomUndefined); TermUndefined = MkAtomTerm(AtomUndefined); + AtomUndefp = AtomAdjust(AtomUndefp); TermUndefp = MkAtomTerm(AtomUndefp); + AtomUndefp0 = AtomAdjust(AtomUndefp0); TermUndefp0 = MkAtomTerm(AtomUndefp0); + AtomUnderflow = AtomAdjust(AtomUnderflow); TermUnderflow = MkAtomTerm(AtomUnderflow); + AtomUnificationStack = AtomAdjust(AtomUnificationStack); TermUnificationStack = MkAtomTerm(AtomUnificationStack); + AtomUnique = AtomAdjust(AtomUnique); TermUnique = MkAtomTerm(AtomUnique); + AtomUnsignedByte = AtomAdjust(AtomUnsignedByte); TermUnsignedByte = MkAtomTerm(AtomUnsignedByte); + AtomUnsignedChar = AtomAdjust(AtomUnsignedChar); TermUnsignedChar = MkAtomTerm(AtomUnsignedChar); + AtomUser = AtomAdjust(AtomUser); TermUser = MkAtomTerm(AtomUser); + AtomUserErr = AtomAdjust(AtomUserErr); TermUserErr = MkAtomTerm(AtomUserErr); + AtomUserIn = AtomAdjust(AtomUserIn); TermUserIn = MkAtomTerm(AtomUserIn); + AtomUserOut = AtomAdjust(AtomUserOut); TermUserOut = MkAtomTerm(AtomUserOut); + AtomDollarVar = AtomAdjust(AtomDollarVar); TermDollarVar = MkAtomTerm(AtomDollarVar); + AtomVBar = AtomAdjust(AtomVBar); TermVBar = MkAtomTerm(AtomVBar); + AtomVarBranches = AtomAdjust(AtomVarBranches); TermVarBranches = MkAtomTerm(AtomVarBranches); + AtomVariableNames = AtomAdjust(AtomVariableNames); TermVariableNames = MkAtomTerm(AtomVariableNames); + AtomHiddenVar = AtomAdjust(AtomHiddenVar); TermHiddenVar = MkAtomTerm(AtomHiddenVar); + AtomVariable = AtomAdjust(AtomVariable); TermVariable = MkAtomTerm(AtomVariable); + AtomVerbose = AtomAdjust(AtomVerbose); TermVerbose = MkAtomTerm(AtomVerbose); + AtomVerboseFileSearch = AtomAdjust(AtomVerboseFileSearch); TermVerboseFileSearch = MkAtomTerm(AtomVerboseFileSearch); + AtomVersionNumber = AtomAdjust(AtomVersionNumber); TermVersionNumber = MkAtomTerm(AtomVersionNumber); + AtomVeryVerbose = AtomAdjust(AtomVeryVerbose); TermVeryVerbose = MkAtomTerm(AtomVeryVerbose); + AtomWakeUpGoal = AtomAdjust(AtomWakeUpGoal); TermWakeUpGoal = MkAtomTerm(AtomWakeUpGoal); + AtomWarning = AtomAdjust(AtomWarning); TermWarning = MkAtomTerm(AtomWarning); + AtomWhen = AtomAdjust(AtomWhen); TermWhen = MkAtomTerm(AtomWhen); + AtomWrite = AtomAdjust(AtomWrite); TermWrite = MkAtomTerm(AtomWrite); + AtomWriteTerm = AtomAdjust(AtomWriteTerm); TermWriteTerm = MkAtomTerm(AtomWriteTerm); + AtomXml = AtomAdjust(AtomXml); TermXml = MkAtomTerm(AtomXml); + AtomYapHacks = AtomAdjust(AtomYapHacks); TermYapHacks = MkAtomTerm(AtomYapHacks); + AtomZeroDivisor = AtomAdjust(AtomZeroDivisor); TermZeroDivisor = MkAtomTerm(AtomZeroDivisor); + FunctorAfInet = FuncAdjust(FunctorAfInet); + FunctorAfLocal = FuncAdjust(FunctorAfLocal); + FunctorAfUnix = FuncAdjust(FunctorAfUnix); + FunctorAltNot = FuncAdjust(FunctorAltNot); + FunctorArg = FuncAdjust(FunctorArg); + FunctorArrayEntry = FuncAdjust(FunctorArrayEntry); + FunctorArrow = FuncAdjust(FunctorArrow); + FunctorDoubleArrow = FuncAdjust(FunctorDoubleArrow); + FunctorAssert1 = FuncAdjust(FunctorAssert1); + FunctorAssert = FuncAdjust(FunctorAssert); + FunctorAtFoundOne = FuncAdjust(FunctorAtFoundOne); + FunctorAtom = FuncAdjust(FunctorAtom); + FunctorAtt1 = FuncAdjust(FunctorAtt1); + FunctorAttGoal = FuncAdjust(FunctorAttGoal); + FunctorBraces = FuncAdjust(FunctorBraces); + FunctorCall = FuncAdjust(FunctorCall); + FunctorCatch = FuncAdjust(FunctorCatch); + FunctorChangeModule = FuncAdjust(FunctorChangeModule); + FunctorChars = FuncAdjust(FunctorChars); + FunctorChars1 = FuncAdjust(FunctorChars1); + FunctorCleanCall = FuncAdjust(FunctorCleanCall); + FunctorClist = FuncAdjust(FunctorClist); + FunctorCodes = FuncAdjust(FunctorCodes); + FunctorCodes1 = FuncAdjust(FunctorCodes1); + FunctorColon = FuncAdjust(FunctorColon); + FunctorComma = FuncAdjust(FunctorComma); + FunctorCommentHook = FuncAdjust(FunctorCommentHook); + FunctorContext2 = FuncAdjust(FunctorContext2); + FunctorConsistencyError = FuncAdjust(FunctorConsistencyError); + FunctorCreep = FuncAdjust(FunctorCreep); + FunctorCsult = FuncAdjust(FunctorCsult); + FunctorCurrentModule = FuncAdjust(FunctorCurrentModule); + FunctorCutBy = FuncAdjust(FunctorCutBy); + FunctorDBREF = FuncAdjust(FunctorDBREF); + FunctorDiff = FuncAdjust(FunctorDiff); + FunctorDoLogUpdClause = FuncAdjust(FunctorDoLogUpdClause); + FunctorDoLogUpdClause0 = FuncAdjust(FunctorDoLogUpdClause0); + FunctorDoLogUpdClauseErase = FuncAdjust(FunctorDoLogUpdClauseErase); + FunctorDoStaticClause = FuncAdjust(FunctorDoStaticClause); + FunctorDollar = FuncAdjust(FunctorDollar); + FunctorDollarVar = FuncAdjust(FunctorDollarVar); + FunctorDomainError = FuncAdjust(FunctorDomainError); + FunctorDot = FuncAdjust(FunctorDot); + FunctorDot10 = FuncAdjust(FunctorDot10); + FunctorDot11 = FuncAdjust(FunctorDot11); + FunctorDot12 = FuncAdjust(FunctorDot12); + FunctorDot2 = FuncAdjust(FunctorDot2); + FunctorDot3 = FuncAdjust(FunctorDot3); + FunctorDot4 = FuncAdjust(FunctorDot4); + FunctorDot5 = FuncAdjust(FunctorDot5); + FunctorDot6 = FuncAdjust(FunctorDot6); + FunctorDot7 = FuncAdjust(FunctorDot7); + FunctorDot8 = FuncAdjust(FunctorDot8); + FunctorDot9 = FuncAdjust(FunctorDot9); + FunctorDoubleArrow = FuncAdjust(FunctorDoubleArrow); + FunctorDoubleSlash = FuncAdjust(FunctorDoubleSlash); + FunctorEmptySquareBrackets = FuncAdjust(FunctorEmptySquareBrackets); + FunctorEq = FuncAdjust(FunctorEq); + FunctorError = FuncAdjust(FunctorError); + FunctorEvaluationError = FuncAdjust(FunctorEvaluationError); + FunctorException = FuncAdjust(FunctorException); + FunctorExecute2InMod = FuncAdjust(FunctorExecute2InMod); + FunctorExecuteInMod = FuncAdjust(FunctorExecuteInMod); + FunctorExecuteWithin = FuncAdjust(FunctorExecuteWithin); + FunctorExistenceError = FuncAdjust(FunctorExistenceError); + FunctorExoClause = FuncAdjust(FunctorExoClause); + FunctorFunctor = FuncAdjust(FunctorFunctor); + FunctorGAtom = FuncAdjust(FunctorGAtom); + FunctorGAtomic = FuncAdjust(FunctorGAtomic); + FunctorGCompound = FuncAdjust(FunctorGCompound); + FunctorGFloat = FuncAdjust(FunctorGFloat); + FunctorGFormatAt = FuncAdjust(FunctorGFormatAt); + FunctorGInteger = FuncAdjust(FunctorGInteger); + FunctorGNumber = FuncAdjust(FunctorGNumber); + FunctorGPrimitive = FuncAdjust(FunctorGPrimitive); + FunctorGVar = FuncAdjust(FunctorGVar); + FunctorGeneratePredInfo = FuncAdjust(FunctorGeneratePredInfo); + FunctorGoalExpansion2 = FuncAdjust(FunctorGoalExpansion2); + FunctorGoalExpansion = FuncAdjust(FunctorGoalExpansion); + FunctorHandleThrow = FuncAdjust(FunctorHandleThrow); + FunctorHat = FuncAdjust(FunctorHat); + FunctorI = FuncAdjust(FunctorI); + FunctorId = FuncAdjust(FunctorId); + FunctorInfo1 = FuncAdjust(FunctorInfo1); + FunctorInfo2 = FuncAdjust(FunctorInfo2); + FunctorInfo3 = FuncAdjust(FunctorInfo3); + FunctorInfo4 = FuncAdjust(FunctorInfo4); + FunctorIs = FuncAdjust(FunctorIs); + FunctorJ = FuncAdjust(FunctorJ); + FunctorLastExecuteWithin = FuncAdjust(FunctorLastExecuteWithin); + FunctorList = FuncAdjust(FunctorList); + FunctorLOOP = FuncAdjust(FunctorLOOP); + FunctorMegaClause = FuncAdjust(FunctorMegaClause); + FunctorMetaCall = FuncAdjust(FunctorMetaCall); + FunctorMinus = FuncAdjust(FunctorMinus); + FunctorModule = FuncAdjust(FunctorModule); + FunctorMultiFileClause = FuncAdjust(FunctorMultiFileClause); + FunctorMutable = FuncAdjust(FunctorMutable); + FunctorMutex = FuncAdjust(FunctorMutex); + FunctorNotImplemented = FuncAdjust(FunctorNotImplemented); + FunctorNBQueue = FuncAdjust(FunctorNBQueue); + FunctorNot = FuncAdjust(FunctorNot); + FunctorObj = FuncAdjust(FunctorObj); + FunctorOr = FuncAdjust(FunctorOr); + FunctorOutput = FuncAdjust(FunctorOutput); + FunctorPermissionError = FuncAdjust(FunctorPermissionError); + FunctorPlus = FuncAdjust(FunctorPlus); + FunctorPortray = FuncAdjust(FunctorPortray); + FunctorPrintMessage = FuncAdjust(FunctorPrintMessage); + FunctorProcedure = FuncAdjust(FunctorProcedure); + FunctorPriority = FuncAdjust(FunctorPriority); + FunctorPrologConstraint = FuncAdjust(FunctorPrologConstraint); + FunctorProtectStack = FuncAdjust(FunctorProtectStack); + FunctorQuery = FuncAdjust(FunctorQuery); + FunctorRecordedWithKey = FuncAdjust(FunctorRecordedWithKey); + FunctorRDiv = FuncAdjust(FunctorRDiv); + FunctorRedoFreeze = FuncAdjust(FunctorRedoFreeze); + FunctorRepresentationError = FuncAdjust(FunctorRepresentationError); + FunctorResourceError = FuncAdjust(FunctorResourceError); + FunctorRestoreRegs = FuncAdjust(FunctorRestoreRegs); + FunctorRestoreRegs1 = FuncAdjust(FunctorRestoreRegs1); + FunctorSafe = FuncAdjust(FunctorSafe); + FunctorSafeCallCleanup = FuncAdjust(FunctorSafeCallCleanup); + FunctorSame = FuncAdjust(FunctorSame); + FunctorSlash = FuncAdjust(FunctorSlash); + FunctorStaticClause = FuncAdjust(FunctorStaticClause); + FunctorStream = FuncAdjust(FunctorStream); + FunctorStreamEOS = FuncAdjust(FunctorStreamEOS); + FunctorStreamPos = FuncAdjust(FunctorStreamPos); + FunctorString1 = FuncAdjust(FunctorString1); + FunctorStyleCheck = FuncAdjust(FunctorStyleCheck); + FunctorSyntaxError = FuncAdjust(FunctorSyntaxError); + FunctorShortSyntaxError = FuncAdjust(FunctorShortSyntaxError); + FunctorTermExpansion = FuncAdjust(FunctorTermExpansion); + FunctorThreadRun = FuncAdjust(FunctorThreadRun); + FunctorThrow = FuncAdjust(FunctorThrow); + FunctorTimeoutError = FuncAdjust(FunctorTimeoutError); + FunctorTraceMetaCall = FuncAdjust(FunctorTraceMetaCall); + FunctorTypeError = FuncAdjust(FunctorTypeError); + FunctorUMinus = FuncAdjust(FunctorUMinus); + FunctorUPlus = FuncAdjust(FunctorUPlus); + FunctorVBar = FuncAdjust(FunctorVBar); + FunctorWriteTerm = FuncAdjust(FunctorWriteTerm); + FunctorHiddenVar = FuncAdjust(FunctorHiddenVar); diff --git a/H/generated/rlocals.h b/H/generated/rlocals.h index 77f95bc68..cddc0d9f2 100644 --- a/H/generated/rlocals.h +++ b/H/generated/rlocals.h @@ -145,6 +145,7 @@ static void RestoreWorker(int wid USES_REGS) { + #ifdef THREADS #endif /* THREADS */ diff --git a/H/generated/tatoms.h b/H/generated/tatoms.h index 24d966852..beee9ff0c 100644 --- a/H/generated/tatoms.h +++ b/H/generated/tatoms.h @@ -1,723 +1,1161 @@ - - /* This file, tatoms.h, was generated automatically by "yap -L misc/buildatoms" - {lease do not update, update misc/ATOMS instead */ - -EXTERNAL Atom Atom3Dots; -EXTERNAL Atom AtomAbol; EXTERNAL Term TermAbol; -EXTERNAL Atom AtomAccess; EXTERNAL Term TermAccess; -EXTERNAL Atom AtomAfInet; EXTERNAL Term TermAfInet; -EXTERNAL Atom AtomAfLocal; EXTERNAL Term TermAfLocal; -EXTERNAL Atom AtomAfUnix; EXTERNAL Term TermAfUnix; -EXTERNAL Atom AtomAlarm; EXTERNAL Term TermAlarm; -EXTERNAL Atom AtomAlias; EXTERNAL Term TermAlias; -EXTERNAL Atom AtomAll; EXTERNAL Term TermAll; -EXTERNAL Atom AtomAltNot; EXTERNAL Term TermAltNot; -EXTERNAL Atom AtomAnswer; EXTERNAL Term TermAnswer; -EXTERNAL Atom AtomAny; EXTERNAL Term TermAny; -EXTERNAL Atom AtomAppend; EXTERNAL Term TermAppend; -EXTERNAL Atom AtomArg; EXTERNAL Term TermArg; -EXTERNAL Atom AtomArray; EXTERNAL Term TermArray; -EXTERNAL Atom AtomArrayAccess; EXTERNAL Term TermArrayAccess; -EXTERNAL Atom AtomArrayOverflow; EXTERNAL Term TermArrayOverflow; -EXTERNAL Atom AtomArrayType; EXTERNAL Term TermArrayType; -EXTERNAL Atom AtomArrow; EXTERNAL Term TermArrow; -EXTERNAL Atom AtomAttributedModule; EXTERNAL Term TermAttributedModule; -EXTERNAL Atom AtomDoubleArrow; EXTERNAL Term TermDoubleArrow; -EXTERNAL Atom AtomAssert; EXTERNAL Term TermAssert; -EXTERNAL Atom AtomBeginBracket; EXTERNAL Term TermBeginBracket; -EXTERNAL Atom AtomEndBracket; EXTERNAL Term TermEndBracket; -EXTERNAL Atom AtomBeginSquareBracket; EXTERNAL Term TermBeginSquareBracket; -EXTERNAL Atom AtomEndSquareBracket; EXTERNAL Term TermEndSquareBracket; -EXTERNAL Atom AtomBeginCurlyBracket; EXTERNAL Term TermBeginCurlyBracket; -EXTERNAL Atom AtomEndCurlyBracket; EXTERNAL Term TermEndCurlyBracket; -EXTERNAL Atom AtomEmptyBrackets; EXTERNAL Term TermEmptyBrackets; -EXTERNAL Atom AtomEmptySquareBrackets; EXTERNAL Term TermEmptySquareBrackets; -EXTERNAL Atom AtomAsserta; EXTERNAL Term TermAsserta; -EXTERNAL Atom AtomAssertaStatic; EXTERNAL Term TermAssertaStatic; -EXTERNAL Atom AtomAssertz; EXTERNAL Term TermAssertz; -EXTERNAL Atom AtomAssertzStatic; EXTERNAL Term TermAssertzStatic; -EXTERNAL Atom AtomAt; EXTERNAL Term TermAt; -EXTERNAL Atom AtomAtom; EXTERNAL Term TermAtom; -EXTERNAL Atom AtomAtomic; EXTERNAL Term TermAtomic; -EXTERNAL Atom AtomAtt; EXTERNAL Term TermAtt; -EXTERNAL Atom AtomAtt1; EXTERNAL Term TermAtt1; -EXTERNAL Atom AtomAttDo; EXTERNAL Term TermAttDo; -EXTERNAL Atom AtomAttributes; EXTERNAL Term TermAttributes; -EXTERNAL Atom AtomB; EXTERNAL Term TermB; -EXTERNAL Atom AtomBatched; EXTERNAL Term TermBatched; -EXTERNAL Atom AtomBetween; EXTERNAL Term TermBetween; -EXTERNAL Atom AtomBinary; EXTERNAL Term TermBinary; -EXTERNAL Atom AtomBigNum; EXTERNAL Term TermBigNum; -EXTERNAL Atom AtomBinaryStream; EXTERNAL Term TermBinaryStream; -EXTERNAL Atom AtomBoolean; EXTERNAL Term TermBoolean; -EXTERNAL Atom AtomBraces; EXTERNAL Term TermBraces; -EXTERNAL Atom AtomBreak; EXTERNAL Term TermBreak; -EXTERNAL Atom AtomByte; EXTERNAL Term TermByte; -EXTERNAL Atom AtomCArith; EXTERNAL Term TermCArith; -EXTERNAL Atom AtomCall; EXTERNAL Term TermCall; -EXTERNAL Atom AtomCallAndRetryCounter; EXTERNAL Term TermCallAndRetryCounter; -EXTERNAL Atom AtomCallCounter; EXTERNAL Term TermCallCounter; -EXTERNAL Atom AtomCallable; EXTERNAL Term TermCallable; -EXTERNAL Atom AtomCatch; EXTERNAL Term TermCatch; -EXTERNAL Atom AtomChangeModule; EXTERNAL Term TermChangeModule; -EXTERNAL Atom AtomChar; EXTERNAL Term TermChar; -EXTERNAL Atom AtomCharsio; EXTERNAL Term TermCharsio; -EXTERNAL Atom AtomCharacter; EXTERNAL Term TermCharacter; -EXTERNAL Atom AtomCharacterCode; EXTERNAL Term TermCharacterCode; -EXTERNAL Atom AtomChars; EXTERNAL Term TermChars; -EXTERNAL Atom AtomCharset; EXTERNAL Term TermCharset; -EXTERNAL Atom AtomChType; EXTERNAL Term TermChType; -EXTERNAL Atom AtomCleanCall; EXTERNAL Term TermCleanCall; -EXTERNAL Atom AtomClose; EXTERNAL Term TermClose; -EXTERNAL Atom AtomColon; EXTERNAL Term TermColon; -EXTERNAL Atom AtomCodeSpace; EXTERNAL Term TermCodeSpace; -EXTERNAL Atom AtomCodes; EXTERNAL Term TermCodes; -EXTERNAL Atom AtomCoInductive; EXTERNAL Term TermCoInductive; -EXTERNAL Atom AtomComma; EXTERNAL Term TermComma; -EXTERNAL Atom AtomCommentHook; EXTERNAL Term TermCommentHook; -EXTERNAL Atom AtomCompact; EXTERNAL Term TermCompact; -EXTERNAL Atom AtomCompound; EXTERNAL Term TermCompound; -EXTERNAL Atom AtomConsistencyError; EXTERNAL Term TermConsistencyError; -EXTERNAL Atom AtomConsult; EXTERNAL Term TermConsult; -EXTERNAL Atom AtomConsultOnBoot; EXTERNAL Term TermConsultOnBoot; -EXTERNAL Atom AtomContext; EXTERNAL Term TermContext; -EXTERNAL Atom AtomCputime; EXTERNAL Term TermCputime; -EXTERNAL Atom AtomCreate; EXTERNAL Term TermCreate; -EXTERNAL Atom AtomCreep; EXTERNAL Term TermCreep; -EXTERNAL Atom AtomCryptAtoms; EXTERNAL Term TermCryptAtoms; -EXTERNAL Atom AtomCurly; EXTERNAL Term TermCurly; -EXTERNAL Atom AtomCsult; EXTERNAL Term TermCsult; -EXTERNAL Atom AtomCurrentModule; EXTERNAL Term TermCurrentModule; -EXTERNAL Atom AtomCut; EXTERNAL Term TermCut; -EXTERNAL Atom AtomCutBy; EXTERNAL Term TermCutBy; -EXTERNAL Atom AtomDAbort; EXTERNAL Term TermDAbort; -EXTERNAL Atom AtomDBLoad; EXTERNAL Term TermDBLoad; -EXTERNAL Atom AtomDBREF; EXTERNAL Term TermDBREF; -EXTERNAL Atom AtomDBReference; EXTERNAL Term TermDBReference; -EXTERNAL Atom AtomDBTerm; EXTERNAL Term TermDBTerm; -EXTERNAL Atom AtomDBref; EXTERNAL Term TermDBref; -EXTERNAL Atom AtomDInteger; EXTERNAL Term TermDInteger; -EXTERNAL Atom AtomDebugMeta; EXTERNAL Term TermDebugMeta; -EXTERNAL Atom AtomDebuggerInput; EXTERNAL Term TermDebuggerInput; -EXTERNAL Atom AtomDec10; EXTERNAL Term TermDec10; -EXTERNAL Atom AtomDefault; EXTERNAL Term TermDefault; -EXTERNAL Atom AtomDevNull; EXTERNAL Term TermDevNull; -EXTERNAL Atom AtomDiff; EXTERNAL Term TermDiff; -EXTERNAL Atom AtomDirectory; EXTERNAL Term TermDirectory; -EXTERNAL Atom AtomDiscontiguous; EXTERNAL Term TermDiscontiguous; -EXTERNAL Atom AtomDiscontiguousWarnings; EXTERNAL Term TermDiscontiguousWarnings; -EXTERNAL Atom AtomDollar; EXTERNAL Term TermDollar; -EXTERNAL Atom AtomDoLogUpdClause; EXTERNAL Term TermDoLogUpdClause; -EXTERNAL Atom AtomDoLogUpdClause0; EXTERNAL Term TermDoLogUpdClause0; -EXTERNAL Atom AtomDoLogUpdClauseErase; EXTERNAL Term TermDoLogUpdClauseErase; -EXTERNAL Atom AtomDollarU; EXTERNAL Term TermDollarU; -EXTERNAL Atom AtomDollarUndef; EXTERNAL Term TermDollarUndef; -EXTERNAL Atom AtomDomainError; EXTERNAL Term TermDomainError; -EXTERNAL Atom AtomDoStaticClause; EXTERNAL Term TermDoStaticClause; -EXTERNAL Atom AtomDots; EXTERNAL Term TermDots; -EXTERNAL Atom AtomDOUBLE; EXTERNAL Term TermDOUBLE; -EXTERNAL Atom AtomDoubleSlash; EXTERNAL Term TermDoubleSlash; -EXTERNAL Atom AtomE; EXTERNAL Term TermE; -EXTERNAL Atom AtomEOFBeforeEOT; EXTERNAL Term TermEOFBeforeEOT; -EXTERNAL Atom AtomEQ; EXTERNAL Term TermEQ; -EXTERNAL Atom AtomEmptyAtom; EXTERNAL Term TermEmptyAtom; -EXTERNAL Atom AtomEncoding; EXTERNAL Term TermEncoding; -EXTERNAL Atom AtomEndOfStream; EXTERNAL Term TermEndOfStream; -EXTERNAL Atom AtomEof; EXTERNAL Term TermEof; -EXTERNAL Atom AtomEOfCode; EXTERNAL Term TermEOfCode; -EXTERNAL Atom AtomEq; EXTERNAL Term TermEq; -EXTERNAL Atom AtomError; EXTERNAL Term TermError; -EXTERNAL Atom AtomException; EXTERNAL Term TermException; -EXTERNAL Atom AtomExtensions; EXTERNAL Term TermExtensions; -EXTERNAL Atom AtomEvaluable; EXTERNAL Term TermEvaluable; -EXTERNAL Atom AtomEvaluationError; EXTERNAL Term TermEvaluationError; -EXTERNAL Atom AtomExecutable; EXTERNAL Term TermExecutable; -EXTERNAL Atom AtomExecute; EXTERNAL Term TermExecute; -EXTERNAL Atom AtomExecAnswers; EXTERNAL Term TermExecAnswers; -EXTERNAL Atom AtomExecuteInMod; EXTERNAL Term TermExecuteInMod; -EXTERNAL Atom AtomExecuteWithin; EXTERNAL Term TermExecuteWithin; -EXTERNAL Atom AtomExecuteWoMod; EXTERNAL Term TermExecuteWoMod; -EXTERNAL Atom AtomExist; EXTERNAL Term TermExist; -EXTERNAL Atom AtomExists; EXTERNAL Term TermExists; -EXTERNAL Atom AtomExit; EXTERNAL Term TermExit; -EXTERNAL Atom AtomExistenceError; EXTERNAL Term TermExistenceError; -EXTERNAL Atom AtomExoClause; EXTERNAL Term TermExoClause; -EXTERNAL Atom AtomExpectedNumber; EXTERNAL Term TermExpectedNumber; -EXTERNAL Atom AtomExpand; EXTERNAL Term TermExpand; -EXTERNAL Atom AtomExtendFileSearchPath; EXTERNAL Term TermExtendFileSearchPath; -EXTERNAL Atom AtomExtendsions; EXTERNAL Term TermExtendsions; -EXTERNAL Atom AtomFB; EXTERNAL Term TermFB; -EXTERNAL Atom AtomFail; EXTERNAL Term TermFail; -EXTERNAL Atom AtomFalse; EXTERNAL Term TermFalse; -EXTERNAL Atom AtomFast; EXTERNAL Term TermFast; -EXTERNAL Atom AtomFastFail; EXTERNAL Term TermFastFail; -EXTERNAL Atom AtomFileErrors; EXTERNAL Term TermFileErrors; -EXTERNAL Atom AtomFileerrors; EXTERNAL Term TermFileerrors; -EXTERNAL Atom AtomFileType; EXTERNAL Term TermFileType; -EXTERNAL Atom AtomFirst; EXTERNAL Term TermFirst; -EXTERNAL Atom AtomFloat; EXTERNAL Term TermFloat; -EXTERNAL Atom AtomFloatFormat; EXTERNAL Term TermFloatFormat; -EXTERNAL Atom AtomFloatOverflow; EXTERNAL Term TermFloatOverflow; -EXTERNAL Atom AtomFloatUnderflow; EXTERNAL Term TermFloatUnderflow; -EXTERNAL Atom AtomFormat; EXTERNAL Term TermFormat; -EXTERNAL Atom AtomFormatAt; EXTERNAL Term TermFormatAt; -EXTERNAL Atom AtomFull; EXTERNAL Term TermFull; -EXTERNAL Atom AtomFunctor; EXTERNAL Term TermFunctor; -EXTERNAL Atom AtomGT; EXTERNAL Term TermGT; -EXTERNAL Atom AtomGVar; EXTERNAL Term TermGVar; -EXTERNAL Atom AtomGc; EXTERNAL Term TermGc; -EXTERNAL Atom AtomGcMargin; EXTERNAL Term TermGcMargin; -EXTERNAL Atom AtomGcTrace; EXTERNAL Term TermGcTrace; -EXTERNAL Atom AtomGcVerbose; EXTERNAL Term TermGcVerbose; -EXTERNAL Atom AtomGcVeryVerbose; EXTERNAL Term TermGcVeryVerbose; -EXTERNAL Atom AtomGeneratePredInfo; EXTERNAL Term TermGeneratePredInfo; -EXTERNAL Atom AtomGetwork; EXTERNAL Term TermGetwork; -EXTERNAL Atom AtomGetworkSeq; EXTERNAL Term TermGetworkSeq; -EXTERNAL Atom AtomGlob; EXTERNAL Term TermGlob; -EXTERNAL Atom AtomGlobal; EXTERNAL Term TermGlobal; -EXTERNAL Atom AtomGlobalSp; EXTERNAL Term TermGlobalSp; -EXTERNAL Atom AtomGlobalTrie; EXTERNAL Term TermGlobalTrie; -EXTERNAL Atom AtomGoalExpansion; EXTERNAL Term TermGoalExpansion; -EXTERNAL Atom AtomHat; EXTERNAL Term TermHat; -EXTERNAL Atom AtomHERE; EXTERNAL Term TermHERE; -EXTERNAL Atom AtomHandleThrow; EXTERNAL Term TermHandleThrow; -EXTERNAL Atom AtomHeap; EXTERNAL Term TermHeap; -EXTERNAL Atom AtomHeapUsed; EXTERNAL Term TermHeapUsed; -EXTERNAL Atom AtomHugeInt; EXTERNAL Term TermHugeInt; -EXTERNAL Atom AtomIDB; EXTERNAL Term TermIDB; -EXTERNAL Atom AtomIOMode; EXTERNAL Term TermIOMode; -EXTERNAL Atom AtomI; EXTERNAL Term TermI; -EXTERNAL Atom AtomId; EXTERNAL Term TermId; -EXTERNAL Atom AtomIgnore; EXTERNAL Term TermIgnore; -EXTERNAL Atom AtomInf; EXTERNAL Term TermInf; -EXTERNAL Atom AtomInfinity; EXTERNAL Term TermInfinity; -EXTERNAL Atom AtomInfo; EXTERNAL Term TermInfo; -EXTERNAL Atom AtomInitGoal; EXTERNAL Term TermInitGoal; -EXTERNAL Atom AtomInitProlog; EXTERNAL Term TermInitProlog; -EXTERNAL Atom AtomInStackExpansion; EXTERNAL Term TermInStackExpansion; -EXTERNAL Atom AtomInput; EXTERNAL Term TermInput; -EXTERNAL Atom AtomInstantiationError; EXTERNAL Term TermInstantiationError; -EXTERNAL Atom AtomInt; EXTERNAL Term TermInt; -EXTERNAL Atom AtomIntOverflow; EXTERNAL Term TermIntOverflow; -EXTERNAL Atom AtomInteger; EXTERNAL Term TermInteger; -EXTERNAL Atom AtomInternalCompilerError; EXTERNAL Term TermInternalCompilerError; -EXTERNAL Atom AtomIs; EXTERNAL Term TermIs; -EXTERNAL Atom AtomJ; EXTERNAL Term TermJ; -EXTERNAL Atom Atoml; EXTERNAL Term Terml; -EXTERNAL Atom AtomKey; EXTERNAL Term TermKey; -EXTERNAL Atom AtomLDLibraryPath; EXTERNAL Term TermLDLibraryPath; -EXTERNAL Atom AtomLONGINT; EXTERNAL Term TermLONGINT; -EXTERNAL Atom AtomLOOP; EXTERNAL Term TermLOOP; -EXTERNAL Atom AtomLoopStream; EXTERNAL Term TermLoopStream; -EXTERNAL Atom AtomLT; EXTERNAL Term TermLT; -EXTERNAL Atom AtomLastExecuteWithin; EXTERNAL Term TermLastExecuteWithin; -EXTERNAL Atom AtomLeash; EXTERNAL Term TermLeash; -EXTERNAL Atom AtomLeast; EXTERNAL Term TermLeast; -EXTERNAL Atom AtomLength; EXTERNAL Term TermLength; -EXTERNAL Atom AtomList; EXTERNAL Term TermList; -EXTERNAL Atom AtomLine; EXTERNAL Term TermLine; -EXTERNAL Atom AtomLive; EXTERNAL Term TermLive; -EXTERNAL Atom AtomLoadAnswers; EXTERNAL Term TermLoadAnswers; -EXTERNAL Atom AtomLocal; EXTERNAL Term TermLocal; -EXTERNAL Atom AtomLocalSp; EXTERNAL Term TermLocalSp; -EXTERNAL Atom AtomLocalTrie; EXTERNAL Term TermLocalTrie; -EXTERNAL Atom AtomMax; EXTERNAL Term TermMax; -EXTERNAL Atom AtomMaximum; EXTERNAL Term TermMaximum; -EXTERNAL Atom AtomMaxArity; EXTERNAL Term TermMaxArity; -EXTERNAL Atom AtomMaxFiles; EXTERNAL Term TermMaxFiles; -EXTERNAL Atom AtomMegaClause; EXTERNAL Term TermMegaClause; -EXTERNAL Atom AtomMetaCall; EXTERNAL Term TermMetaCall; -EXTERNAL Atom AtomMfClause; EXTERNAL Term TermMfClause; -EXTERNAL Atom AtomMin; EXTERNAL Term TermMin; -EXTERNAL Atom AtomMinimum; EXTERNAL Term TermMinimum; -EXTERNAL Atom AtomMinus; EXTERNAL Term TermMinus; -EXTERNAL Atom AtomModify; EXTERNAL Term TermModify; -EXTERNAL Atom AtomModule; EXTERNAL Term TermModule; -EXTERNAL Atom AtomMost; EXTERNAL Term TermMost; -EXTERNAL Atom AtomMulti; EXTERNAL Term TermMulti; -EXTERNAL Atom AtomMultiFile; EXTERNAL Term TermMultiFile; -EXTERNAL Atom AtomMultiple; EXTERNAL Term TermMultiple; -EXTERNAL Atom AtomMutable; EXTERNAL Term TermMutable; -EXTERNAL Atom AtomMutableVariable; EXTERNAL Term TermMutableVariable; -EXTERNAL Atom AtomMutex; EXTERNAL Term TermMutex; -EXTERNAL Atom AtomMyddasDB; EXTERNAL Term TermMyddasDB; -EXTERNAL Atom AtomMyddasGoal; EXTERNAL Term TermMyddasGoal; -EXTERNAL Atom AtomMyddasHost; EXTERNAL Term TermMyddasHost; -EXTERNAL Atom AtomMyddasPass; EXTERNAL Term TermMyddasPass; -EXTERNAL Atom AtomMyddasUser; EXTERNAL Term TermMyddasUser; -EXTERNAL Atom AtomMyddasVersionName; EXTERNAL Term TermMyddasVersionName; -EXTERNAL Atom AtomNan; EXTERNAL Term TermNan; -EXTERNAL Atom AtomNb; EXTERNAL Term TermNb; -EXTERNAL Atom AtomNbTerm; EXTERNAL Term TermNbTerm; -EXTERNAL Atom AtomNew; EXTERNAL Term TermNew; -EXTERNAL Atom AtomNewLine; EXTERNAL Term TermNewLine; -EXTERNAL Atom AtomNl; EXTERNAL Term TermNl; -EXTERNAL Atom AtomNoEffect; EXTERNAL Term TermNoEffect; -EXTERNAL Atom AtomNoMemory; EXTERNAL Term TermNoMemory; -EXTERNAL Atom AtomNone; EXTERNAL Term TermNone; -EXTERNAL Atom AtomNonEmptyList; EXTERNAL Term TermNonEmptyList; -EXTERNAL Atom AtomNot; EXTERNAL Term TermNot; -EXTERNAL Atom AtomNotImplemented; EXTERNAL Term TermNotImplemented; -EXTERNAL Atom AtomNotLessThanZero; EXTERNAL Term TermNotLessThanZero; -EXTERNAL Atom AtomNotNewline; EXTERNAL Term TermNotNewline; -EXTERNAL Atom AtomNotZero; EXTERNAL Term TermNotZero; -EXTERNAL Atom AtomNumber; EXTERNAL Term TermNumber; -EXTERNAL Atom AtomObj; EXTERNAL Term TermObj; -EXTERNAL Atom AtomOff; EXTERNAL Term TermOff; -EXTERNAL Atom AtomOffline; EXTERNAL Term TermOffline; -EXTERNAL Atom AtomOn; EXTERNAL Term TermOn; -EXTERNAL Atom AtomOnline; EXTERNAL Term TermOnline; -EXTERNAL Atom AtomOpen; EXTERNAL Term TermOpen; -EXTERNAL Atom AtomOperatingSystemError; EXTERNAL Term TermOperatingSystemError; -EXTERNAL Atom AtomOperatingSystemSupport; EXTERNAL Term TermOperatingSystemSupport; -EXTERNAL Atom AtomOperator; EXTERNAL Term TermOperator; -EXTERNAL Atom AtomOperatorPriority; EXTERNAL Term TermOperatorPriority; -EXTERNAL Atom AtomOperatorSpecifier; EXTERNAL Term TermOperatorSpecifier; -EXTERNAL Atom AtomOpt; EXTERNAL Term TermOpt; -EXTERNAL Atom AtomOtherwise; EXTERNAL Term TermOtherwise; -EXTERNAL Atom AtomOutOfAttvarsError; EXTERNAL Term TermOutOfAttvarsError; -EXTERNAL Atom AtomOutOfAuxspaceError; EXTERNAL Term TermOutOfAuxspaceError; -EXTERNAL Atom AtomOutOfHeapError; EXTERNAL Term TermOutOfHeapError; -EXTERNAL Atom AtomOutOfRange; EXTERNAL Term TermOutOfRange; -EXTERNAL Atom AtomOutOfStackError; EXTERNAL Term TermOutOfStackError; -EXTERNAL Atom AtomOutOfTrailError; EXTERNAL Term TermOutOfTrailError; -EXTERNAL Atom AtomOutput; EXTERNAL Term TermOutput; -EXTERNAL Atom AtomParameter; EXTERNAL Term TermParameter; -EXTERNAL Atom AtomPrologCommonsDir; EXTERNAL Term TermPrologCommonsDir; -EXTERNAL Atom AtomPast; EXTERNAL Term TermPast; -EXTERNAL Atom AtomPastEndOfStream; EXTERNAL Term TermPastEndOfStream; -EXTERNAL Atom AtomPermissionError; EXTERNAL Term TermPermissionError; -EXTERNAL Atom AtomPi; EXTERNAL Term TermPi; -EXTERNAL Atom AtomPipe; EXTERNAL Term TermPipe; -EXTERNAL Atom AtomPlus; EXTERNAL Term TermPlus; -EXTERNAL Atom AtomPointer; EXTERNAL Term TermPointer; -EXTERNAL Atom AtomPortray; EXTERNAL Term TermPortray; -EXTERNAL Atom AtomPredicateIndicator; EXTERNAL Term TermPredicateIndicator; -EXTERNAL Atom AtomPrimitive; EXTERNAL Term TermPrimitive; -EXTERNAL Atom AtomPrintMessage; EXTERNAL Term TermPrintMessage; -EXTERNAL Atom AtomPrivateProcedure; EXTERNAL Term TermPrivateProcedure; -EXTERNAL Atom AtomProcedure; EXTERNAL Term TermProcedure; -EXTERNAL Atom AtomProfile; EXTERNAL Term TermProfile; -EXTERNAL Atom AtomProlog; EXTERNAL Term TermProlog; -EXTERNAL Atom AtomProtectStack; EXTERNAL Term TermProtectStack; -EXTERNAL Atom AtomQly; EXTERNAL Term TermQly; -EXTERNAL Atom AtomQuery; EXTERNAL Term TermQuery; -EXTERNAL Atom AtomQueue; EXTERNAL Term TermQueue; -EXTERNAL Atom AtomQuiet; EXTERNAL Term TermQuiet; -EXTERNAL Atom AtomRadix; EXTERNAL Term TermRadix; -EXTERNAL Atom AtomRandom; EXTERNAL Term TermRandom; -EXTERNAL Atom AtomRange; EXTERNAL Term TermRange; -EXTERNAL Atom AtomRDiv; EXTERNAL Term TermRDiv; -EXTERNAL Atom AtomRead; EXTERNAL Term TermRead; -EXTERNAL Atom AtomReadOnly; EXTERNAL Term TermReadOnly; -EXTERNAL Atom AtomReadWrite; EXTERNAL Term TermReadWrite; -EXTERNAL Atom AtomReadutil; EXTERNAL Term TermReadutil; -EXTERNAL Atom AtomReconsult; EXTERNAL Term TermReconsult; -EXTERNAL Atom AtomRecordedP; EXTERNAL Term TermRecordedP; -EXTERNAL Atom AtomRecordedWithKey; EXTERNAL Term TermRecordedWithKey; -EXTERNAL Atom AtomRedefineWarnings; EXTERNAL Term TermRedefineWarnings; -EXTERNAL Atom AtomRedoFreeze; EXTERNAL Term TermRedoFreeze; -EXTERNAL Atom AtomRefoundVar; EXTERNAL Term TermRefoundVar; -EXTERNAL Atom AtomRelativeTo; EXTERNAL Term TermRelativeTo; -EXTERNAL Atom AtomRepeat; EXTERNAL Term TermRepeat; -EXTERNAL Atom AtomRepeatSpace; EXTERNAL Term TermRepeatSpace; -EXTERNAL Atom AtomReposition; EXTERNAL Term TermReposition; -EXTERNAL Atom AtomRepresentationError; EXTERNAL Term TermRepresentationError; -EXTERNAL Atom AtomReset; EXTERNAL Term TermReset; -EXTERNAL Atom AtomResize; EXTERNAL Term TermResize; -EXTERNAL Atom AtomResourceError; EXTERNAL Term TermResourceError; -EXTERNAL Atom AtomRestoreRegs; EXTERNAL Term TermRestoreRegs; -EXTERNAL Atom AtomRetry; EXTERNAL Term TermRetry; -EXTERNAL Atom AtomRetryCounter; EXTERNAL Term TermRetryCounter; -EXTERNAL Atom AtomRTree; EXTERNAL Term TermRTree; -EXTERNAL Atom AtomSafe; EXTERNAL Term TermSafe; -EXTERNAL Atom AtomSafeCallCleanup; EXTERNAL Term TermSafeCallCleanup; -EXTERNAL Atom AtomSame; EXTERNAL Term TermSame; -EXTERNAL Atom AtomSemic; EXTERNAL Term TermSemic; -EXTERNAL Atom AtomShiftCountOverflow; EXTERNAL Term TermShiftCountOverflow; -EXTERNAL Atom AtomSigAlarm; EXTERNAL Term TermSigAlarm; -EXTERNAL Atom AtomSigBreak; EXTERNAL Term TermSigBreak; -EXTERNAL Atom AtomSigCreep; EXTERNAL Term TermSigCreep; -EXTERNAL Atom AtomSigDebug; EXTERNAL Term TermSigDebug; -EXTERNAL Atom AtomSigDelayCreep; EXTERNAL Term TermSigDelayCreep; -EXTERNAL Atom AtomSigFPE; EXTERNAL Term TermSigFPE; -EXTERNAL Atom AtomSigHup; EXTERNAL Term TermSigHup; -EXTERNAL Atom AtomSigInt; EXTERNAL Term TermSigInt; -EXTERNAL Atom AtomSigIti; EXTERNAL Term TermSigIti; -EXTERNAL Atom AtomSigPending; EXTERNAL Term TermSigPending; -EXTERNAL Atom AtomSigPipe; EXTERNAL Term TermSigPipe; -EXTERNAL Atom AtomSigStackDump; EXTERNAL Term TermSigStackDump; -EXTERNAL Atom AtomSigStatistics; EXTERNAL Term TermSigStatistics; -EXTERNAL Atom AtomSigTrace; EXTERNAL Term TermSigTrace; -EXTERNAL Atom AtomSigUsr1; EXTERNAL Term TermSigUsr1; -EXTERNAL Atom AtomSigUsr2; EXTERNAL Term TermSigUsr2; -EXTERNAL Atom AtomSigVTAlarm; EXTERNAL Term TermSigVTAlarm; -EXTERNAL Atom AtomSigWakeUp; EXTERNAL Term TermSigWakeUp; -EXTERNAL Atom AtomSilent; EXTERNAL Term TermSilent; -EXTERNAL Atom AtomSingle; EXTERNAL Term TermSingle; -EXTERNAL Atom AtomSingleVarWarnings; EXTERNAL Term TermSingleVarWarnings; -EXTERNAL Atom AtomSingleton; EXTERNAL Term TermSingleton; -EXTERNAL Atom AtomSlash; EXTERNAL Term TermSlash; -EXTERNAL Atom AtomSocket; EXTERNAL Term TermSocket; -EXTERNAL Atom AtomSolutions; EXTERNAL Term TermSolutions; -EXTERNAL Atom AtomSource; EXTERNAL Term TermSource; -EXTERNAL Atom AtomSourceSink; EXTERNAL Term TermSourceSink; -EXTERNAL Atom AtomSpy; EXTERNAL Term TermSpy; -EXTERNAL Atom AtomStack; EXTERNAL Term TermStack; -EXTERNAL Atom AtomStackFree; EXTERNAL Term TermStackFree; -EXTERNAL Atom AtomStartupSavedState; EXTERNAL Term TermStartupSavedState; -EXTERNAL Atom AtomStaticClause; EXTERNAL Term TermStaticClause; -EXTERNAL Atom AtomStaticProcedure; EXTERNAL Term TermStaticProcedure; -EXTERNAL Atom AtomStream; EXTERNAL Term TermStream; -EXTERNAL Atom AtomSWIStream; EXTERNAL Term TermSWIStream; -EXTERNAL Atom AtomVStream; EXTERNAL Term TermVStream; -EXTERNAL Atom AtomStreams; EXTERNAL Term TermStreams; -EXTERNAL Atom AtomStreamOrAlias; EXTERNAL Term TermStreamOrAlias; -EXTERNAL Atom AtomStreamPos; EXTERNAL Term TermStreamPos; -EXTERNAL Atom AtomStreamPosition; EXTERNAL Term TermStreamPosition; -EXTERNAL Atom AtomString; EXTERNAL Term TermString; -EXTERNAL Atom AtomStyleCheck; EXTERNAL Term TermStyleCheck; -EXTERNAL Atom AtomSTRING; EXTERNAL Term TermSTRING; -EXTERNAL Atom AtomSwi; EXTERNAL Term TermSwi; -EXTERNAL Atom AtomSymbolChar; EXTERNAL Term TermSymbolChar; -EXTERNAL Atom AtomSyntaxError; EXTERNAL Term TermSyntaxError; -EXTERNAL Atom AtomSyntaxErrors; EXTERNAL Term TermSyntaxErrors; -EXTERNAL Atom AtomSyntaxErrorHandler; EXTERNAL Term TermSyntaxErrorHandler; -EXTERNAL Atom AtomSystem; EXTERNAL Term TermSystem; -EXTERNAL Atom AtomSystemError; EXTERNAL Term TermSystemError; -EXTERNAL Atom AtomSystemLibraryDir; EXTERNAL Term TermSystemLibraryDir; -EXTERNAL Atom AtomT; EXTERNAL Term TermT; -EXTERNAL Atom AtomTerm; EXTERNAL Term TermTerm; -EXTERNAL Atom AtomTermExpansion; EXTERNAL Term TermTermExpansion; -EXTERNAL Atom AtomTerms; EXTERNAL Term TermTerms; -EXTERNAL Atom AtomText; EXTERNAL Term TermText; -EXTERNAL Atom AtomTextStream; EXTERNAL Term TermTextStream; -EXTERNAL Atom AtomThread; EXTERNAL Term TermThread; -EXTERNAL Atom AtomThreads; EXTERNAL Term TermThreads; -EXTERNAL Atom AtomThrow; EXTERNAL Term TermThrow; -EXTERNAL Atom AtomTimeOutSpec; EXTERNAL Term TermTimeOutSpec; -EXTERNAL Atom AtomTimeoutError; EXTERNAL Term TermTimeoutError; -EXTERNAL Atom AtomTopLevelGoal; EXTERNAL Term TermTopLevelGoal; -EXTERNAL Atom AtomTopThreadGoal; EXTERNAL Term TermTopThreadGoal; -EXTERNAL Atom AtomTraceMetaCall; EXTERNAL Term TermTraceMetaCall; -EXTERNAL Atom AtomTrail; -EXTERNAL Atom AtomTrue; EXTERNAL Term TermTrue; -EXTERNAL Atom AtomTty; EXTERNAL Term TermTty; -EXTERNAL Atom AtomTtys; EXTERNAL Term TermTtys; -EXTERNAL Atom AtomTuple; EXTERNAL Term TermTuple; -EXTERNAL Atom AtomTxt; EXTERNAL Term TermTxt; -EXTERNAL Atom AtomTypeError; EXTERNAL Term TermTypeError; -EXTERNAL Atom AtomUndefined; EXTERNAL Term TermUndefined; -EXTERNAL Atom AtomUndefp; EXTERNAL Term TermUndefp; -EXTERNAL Atom AtomUndefp0; EXTERNAL Term TermUndefp0; -EXTERNAL Atom AtomUnderflow; EXTERNAL Term TermUnderflow; -EXTERNAL Atom AtomUnificationStack; EXTERNAL Term TermUnificationStack; -EXTERNAL Atom AtomUnique; EXTERNAL Term TermUnique; -EXTERNAL Atom AtomUnsignedByte; EXTERNAL Term TermUnsignedByte; -EXTERNAL Atom AtomUnsignedChar; EXTERNAL Term TermUnsignedChar; -EXTERNAL Atom AtomUser; EXTERNAL Term TermUser; -EXTERNAL Atom AtomUserErr; EXTERNAL Term TermUserErr; -EXTERNAL Atom AtomUserIn; EXTERNAL Term TermUserIn; -EXTERNAL Atom AtomUserOut; EXTERNAL Term TermUserOut; -EXTERNAL Atom AtomDollarVar; EXTERNAL Term TermDollarVar; -EXTERNAL Atom AtomVBar; EXTERNAL Term TermVBar; -EXTERNAL Atom AtomVarBranches; EXTERNAL Term TermVarBranches; -EXTERNAL Atom AtomVariableNames; EXTERNAL Term TermVariableNames; -EXTERNAL Atom AtomHiddenVar; EXTERNAL Term TermHiddenVar; -EXTERNAL Atom AtomVariable; EXTERNAL Term TermVariable; -EXTERNAL Atom AtomVerbose; EXTERNAL Term TermVerbose; -EXTERNAL Atom AtomVerboseFileSearch; EXTERNAL Term TermVerboseFileSearch; -EXTERNAL Atom AtomVersionNumber; EXTERNAL Term TermVersionNumber; -EXTERNAL Atom AtomVeryVerbose; EXTERNAL Term TermVeryVerbose; -EXTERNAL Atom AtomWakeUpGoal; EXTERNAL Term TermWakeUpGoal; -EXTERNAL Atom AtomWarning; EXTERNAL Term TermWarning; -EXTERNAL Atom AtomWhen; EXTERNAL Term TermWhen; -EXTERNAL Atom AtomWrite; EXTERNAL Term TermWrite; -EXTERNAL Atom AtomWriteTerm; EXTERNAL Term TermWriteTerm; -EXTERNAL Atom AtomXml; EXTERNAL Term TermXml; -EXTERNAL Atom AtomYapHacks; EXTERNAL Term TermYapHacks; -EXTERNAL Atom AtomZeroDivisor; EXTERNAL Term TermZeroDivisor; -EXTERNAL Functor FunctorAfInet; - -EXTERNAL Functor FunctorAfLocal; - -EXTERNAL Functor FunctorAfUnix; - -EXTERNAL Functor FunctorAltNot; - -EXTERNAL Functor FunctorArg; - -EXTERNAL Functor FunctorArrayEntry; - -EXTERNAL Functor FunctorArrow; - -EXTERNAL Functor FunctorDoubleArrow; - -EXTERNAL Functor FunctorAssert1; - -EXTERNAL Functor FunctorAssert; - -EXTERNAL Functor FunctorAtFoundOne; - -EXTERNAL Functor FunctorAtom; - -EXTERNAL Functor FunctorAtt1; - -EXTERNAL Functor FunctorAttGoal; - -EXTERNAL Functor FunctorBraces; - -EXTERNAL Functor FunctorCall; - -EXTERNAL Functor FunctorCatch; - -EXTERNAL Functor FunctorChangeModule; - -EXTERNAL Functor FunctorChars; - -EXTERNAL Functor FunctorChars1; - -EXTERNAL Functor FunctorCleanCall; - -EXTERNAL Functor FunctorClist; - -EXTERNAL Functor FunctorCodes; - -EXTERNAL Functor FunctorCodes1; - -EXTERNAL Functor FunctorColon; - -EXTERNAL Functor FunctorComma; - -EXTERNAL Functor FunctorCommentHook; - -EXTERNAL Functor FunctorContext2; - -EXTERNAL Functor FunctorConsistencyError; - -EXTERNAL Functor FunctorCreep; - -EXTERNAL Functor FunctorCsult; - -EXTERNAL Functor FunctorCurrentModule; - -EXTERNAL Functor FunctorCutBy; - -EXTERNAL Functor FunctorDBREF; - -EXTERNAL Functor FunctorDiff; - -EXTERNAL Functor FunctorDoLogUpdClause; - -EXTERNAL Functor FunctorDoLogUpdClause0; - -EXTERNAL Functor FunctorDoLogUpdClauseErase; - -EXTERNAL Functor FunctorDoStaticClause; - -EXTERNAL Functor FunctorDollar; - -EXTERNAL Functor FunctorDollarVar; - -EXTERNAL Functor FunctorDomainError; - -EXTERNAL Functor FunctorDot; - -EXTERNAL Functor FunctorDot10; - -EXTERNAL Functor FunctorDot11; - -EXTERNAL Functor FunctorDot12; - -EXTERNAL Functor FunctorDot2; - -EXTERNAL Functor FunctorDot3; - -EXTERNAL Functor FunctorDot4; - -EXTERNAL Functor FunctorDot5; - -EXTERNAL Functor FunctorDot6; - -EXTERNAL Functor FunctorDot7; - -EXTERNAL Functor FunctorDot8; - -EXTERNAL Functor FunctorDot9; - -EXTERNAL Functor FunctorDoubleArrow; - -EXTERNAL Functor FunctorDoubleSlash; - -EXTERNAL Functor FunctorEmptySquareBrackets; - -EXTERNAL Functor FunctorEq; - -EXTERNAL Functor FunctorError; - -EXTERNAL Functor FunctorEvaluationError; - -EXTERNAL Functor FunctorException; - -EXTERNAL Functor FunctorExecute2InMod; - -EXTERNAL Functor FunctorExecuteInMod; - -EXTERNAL Functor FunctorExecuteWithin; - -EXTERNAL Functor FunctorExistenceError; - -EXTERNAL Functor FunctorExoClause; - -EXTERNAL Functor FunctorFunctor; - -EXTERNAL Functor FunctorGAtom; - -EXTERNAL Functor FunctorGAtomic; - -EXTERNAL Functor FunctorGCompound; - -EXTERNAL Functor FunctorGFloat; - -EXTERNAL Functor FunctorGFormatAt; - -EXTERNAL Functor FunctorGInteger; - -EXTERNAL Functor FunctorGNumber; - -EXTERNAL Functor FunctorGPrimitive; - -EXTERNAL Functor FunctorGVar; - -EXTERNAL Functor FunctorGeneratePredInfo; - -EXTERNAL Functor FunctorGoalExpansion2; - -EXTERNAL Functor FunctorGoalExpansion; - -EXTERNAL Functor FunctorHandleThrow; - -EXTERNAL Functor FunctorHat; - -EXTERNAL Functor FunctorI; - -EXTERNAL Functor FunctorId; - -EXTERNAL Functor FunctorInfo1; - -EXTERNAL Functor FunctorInfo2; - -EXTERNAL Functor FunctorInfo3; - -EXTERNAL Functor FunctorInfo4; - -EXTERNAL Functor FunctorIs; - -EXTERNAL Functor FunctorJ; - -EXTERNAL Functor FunctorLastExecuteWithin; - -EXTERNAL Functor FunctorList; - -EXTERNAL Functor FunctorLOOP; - -EXTERNAL Functor FunctorMegaClause; - -EXTERNAL Functor FunctorMetaCall; - -EXTERNAL Functor FunctorMinus; - -EXTERNAL Functor FunctorModule; - -EXTERNAL Functor FunctorMultiFileClause; - -EXTERNAL Functor FunctorMutable; - -EXTERNAL Functor FunctorMutex; - -EXTERNAL Functor FunctorNotImplemented; - -EXTERNAL Functor FunctorNBQueue; - -EXTERNAL Functor FunctorNot; - -EXTERNAL Functor FunctorObj; - -EXTERNAL Functor FunctorOr; - -EXTERNAL Functor FunctorPermissionError; - -EXTERNAL Functor FunctorPlus; - -EXTERNAL Functor FunctorPortray; - -EXTERNAL Functor FunctorPrintMessage; - -EXTERNAL Functor FunctorProcedure; - -EXTERNAL Functor FunctorPrologConstraint; - -EXTERNAL Functor FunctorProtectStack; - -EXTERNAL Functor FunctorQuery; - -EXTERNAL Functor FunctorRecordedWithKey; - -EXTERNAL Functor FunctorRDiv; - -EXTERNAL Functor FunctorRedoFreeze; - -EXTERNAL Functor FunctorRepresentationError; - -EXTERNAL Functor FunctorResourceError; - -EXTERNAL Functor FunctorRestoreRegs; - -EXTERNAL Functor FunctorRestoreRegs1; - -EXTERNAL Functor FunctorSafe; - -EXTERNAL Functor FunctorSafeCallCleanup; - -EXTERNAL Functor FunctorSame; - -EXTERNAL Functor FunctorSlash; - -EXTERNAL Functor FunctorStaticClause; - -EXTERNAL Functor FunctorStream; - -EXTERNAL Functor FunctorStreamEOS; - -EXTERNAL Functor FunctorStreamPos; - -EXTERNAL Functor FunctorString1; - -EXTERNAL Functor FunctorStyleCheck; - -EXTERNAL Functor FunctorSyntaxError; - -EXTERNAL Functor FunctorShortSyntaxError; - -EXTERNAL Functor FunctorTermExpansion; - -EXTERNAL Functor FunctorThreadRun; - -EXTERNAL Functor FunctorThrow; - -EXTERNAL Functor FunctorTimeoutError; - -EXTERNAL Functor FunctorTraceMetaCall; - -EXTERNAL Functor FunctorTypeError; - -EXTERNAL Functor FunctorUMinus; - -EXTERNAL Functor FunctorUPlus; - -EXTERNAL Functor FunctorVBar; - -EXTERNAL Functor FunctorWriteTerm; - -EXTERNAL Functor FunctorHiddenVar; - + +/* This file, tatoms.h, was generated automatically by "yap -L misc/buildatoms" + {lease do not update, update misc/ATOMS instead */ + +X_API EXTERNAL Atom Atom3Dots; +X_API EXTERNAL Atom AtomAbol; +X_API EXTERNAL Term TermAbol; +X_API EXTERNAL Atom AtomAccess; +X_API EXTERNAL Term TermAccess; +X_API EXTERNAL Atom AtomAfInet; +X_API EXTERNAL Term TermAfInet; +X_API EXTERNAL Atom AtomAfLocal; +X_API EXTERNAL Term TermAfLocal; +X_API EXTERNAL Atom AtomAfUnix; +X_API EXTERNAL Term TermAfUnix; +X_API EXTERNAL Atom AtomAlarm; +X_API EXTERNAL Term TermAlarm; +X_API EXTERNAL Atom AtomAlias; +X_API EXTERNAL Term TermAlias; +X_API EXTERNAL Atom AtomAll; +X_API EXTERNAL Term TermAll; +X_API EXTERNAL Atom AtomAltNot; +X_API EXTERNAL Term TermAltNot; +X_API EXTERNAL Atom AtomAnswer; +X_API EXTERNAL Term TermAnswer; +X_API EXTERNAL Atom AtomAny; +X_API EXTERNAL Term TermAny; +X_API EXTERNAL Atom AtomAppend; +X_API EXTERNAL Term TermAppend; +X_API EXTERNAL Atom AtomArg; +X_API EXTERNAL Term TermArg; +X_API EXTERNAL Atom AtomArray; +X_API EXTERNAL Term TermArray; +X_API EXTERNAL Atom AtomArrayAccess; +X_API EXTERNAL Term TermArrayAccess; +X_API EXTERNAL Atom AtomArrayOverflow; +X_API EXTERNAL Term TermArrayOverflow; +X_API EXTERNAL Atom AtomArrayType; +X_API EXTERNAL Term TermArrayType; +X_API EXTERNAL Atom AtomArrow; +X_API EXTERNAL Term TermArrow; +X_API EXTERNAL Atom AtomAttributedModule; +X_API EXTERNAL Term TermAttributedModule; +X_API EXTERNAL Atom AtomDoubleArrow; +X_API EXTERNAL Term TermDoubleArrow; +X_API EXTERNAL Atom AtomAssert; +X_API EXTERNAL Term TermAssert; +X_API EXTERNAL Atom AtomBeginBracket; +X_API EXTERNAL Term TermBeginBracket; +X_API EXTERNAL Atom AtomEndBracket; +X_API EXTERNAL Term TermEndBracket; +X_API EXTERNAL Atom AtomBeginSquareBracket; +X_API EXTERNAL Term TermBeginSquareBracket; +X_API EXTERNAL Atom AtomEndSquareBracket; +X_API EXTERNAL Term TermEndSquareBracket; +X_API EXTERNAL Atom AtomBeginCurlyBracket; +X_API EXTERNAL Term TermBeginCurlyBracket; +X_API EXTERNAL Atom AtomEndCurlyBracket; +X_API EXTERNAL Term TermEndCurlyBracket; +X_API EXTERNAL Atom AtomEmptyBrackets; +X_API EXTERNAL Term TermEmptyBrackets; +X_API EXTERNAL Atom AtomEmptySquareBrackets; +X_API EXTERNAL Term TermEmptySquareBrackets; +X_API EXTERNAL Atom AtomAsserta; +X_API EXTERNAL Term TermAsserta; +X_API EXTERNAL Atom AtomAssertaStatic; +X_API EXTERNAL Term TermAssertaStatic; +X_API EXTERNAL Atom AtomAssertz; +X_API EXTERNAL Term TermAssertz; +X_API EXTERNAL Atom AtomAssertzStatic; +X_API EXTERNAL Term TermAssertzStatic; +X_API EXTERNAL Atom AtomAt; +X_API EXTERNAL Term TermAt; +X_API EXTERNAL Atom AtomAtom; +X_API EXTERNAL Term TermAtom; +X_API EXTERNAL Atom AtomAtomic; +X_API EXTERNAL Term TermAtomic; +X_API EXTERNAL Atom AtomAtt; +X_API EXTERNAL Term TermAtt; +X_API EXTERNAL Atom AtomAtt1; +X_API EXTERNAL Term TermAtt1; +X_API EXTERNAL Atom AtomAttDo; +X_API EXTERNAL Term TermAttDo; +X_API EXTERNAL Atom AtomAttributes; +X_API EXTERNAL Term TermAttributes; +X_API EXTERNAL Atom AtomB; +X_API EXTERNAL Term TermB; +X_API EXTERNAL Atom AtomBatched; +X_API EXTERNAL Term TermBatched; +X_API EXTERNAL Atom AtomBetween; +X_API EXTERNAL Term TermBetween; +X_API EXTERNAL Atom AtomBinary; +X_API EXTERNAL Term TermBinary; +X_API EXTERNAL Atom AtomBigNum; +X_API EXTERNAL Term TermBigNum; +X_API EXTERNAL Atom AtomBinaryStream; +X_API EXTERNAL Term TermBinaryStream; +X_API EXTERNAL Atom AtomBoolean; +X_API EXTERNAL Term TermBoolean; +X_API EXTERNAL Atom AtomBraces; +X_API EXTERNAL Term TermBraces; +X_API EXTERNAL Atom AtomBreak; +X_API EXTERNAL Term TermBreak; +X_API EXTERNAL Atom AtomByte; +X_API EXTERNAL Term TermByte; +X_API EXTERNAL Atom AtomCArith; +X_API EXTERNAL Term TermCArith; +X_API EXTERNAL Atom AtomCall; +X_API EXTERNAL Term TermCall; +X_API EXTERNAL Atom AtomCallAndRetryCounter; +X_API EXTERNAL Term TermCallAndRetryCounter; +X_API EXTERNAL Atom AtomCallCounter; +X_API EXTERNAL Term TermCallCounter; +X_API EXTERNAL Atom AtomCallable; +X_API EXTERNAL Term TermCallable; +X_API EXTERNAL Atom AtomCatch; +X_API EXTERNAL Term TermCatch; +X_API EXTERNAL Atom AtomChangeModule; +X_API EXTERNAL Term TermChangeModule; +X_API EXTERNAL Atom AtomChar; +X_API EXTERNAL Term TermChar; +X_API EXTERNAL Atom AtomCharsio; +X_API EXTERNAL Term TermCharsio; +X_API EXTERNAL Atom AtomCharacter; +X_API EXTERNAL Term TermCharacter; +X_API EXTERNAL Atom AtomCharacterCode; +X_API EXTERNAL Term TermCharacterCode; +X_API EXTERNAL Atom AtomChars; +X_API EXTERNAL Term TermChars; +X_API EXTERNAL Atom AtomCharset; +X_API EXTERNAL Term TermCharset; +X_API EXTERNAL Atom AtomChType; +X_API EXTERNAL Term TermChType; +X_API EXTERNAL Atom AtomCleanCall; +X_API EXTERNAL Term TermCleanCall; +X_API EXTERNAL Atom AtomClose; +X_API EXTERNAL Term TermClose; +X_API EXTERNAL Atom AtomColon; +X_API EXTERNAL Term TermColon; +X_API EXTERNAL Atom AtomCodeSpace; +X_API EXTERNAL Term TermCodeSpace; +X_API EXTERNAL Atom AtomCodes; +X_API EXTERNAL Term TermCodes; +X_API EXTERNAL Atom AtomCoInductive; +X_API EXTERNAL Term TermCoInductive; +X_API EXTERNAL Atom AtomComma; +X_API EXTERNAL Term TermComma; +X_API EXTERNAL Atom AtomCommentHook; +X_API EXTERNAL Term TermCommentHook; +X_API EXTERNAL Atom AtomCompact; +X_API EXTERNAL Term TermCompact; +X_API EXTERNAL Atom AtomCompound; +X_API EXTERNAL Term TermCompound; +X_API EXTERNAL Atom AtomConsistencyError; +X_API EXTERNAL Term TermConsistencyError; +X_API EXTERNAL Atom AtomConsult; +X_API EXTERNAL Term TermConsult; +X_API EXTERNAL Atom AtomConsultOnBoot; +X_API EXTERNAL Term TermConsultOnBoot; +X_API EXTERNAL Atom AtomContext; +X_API EXTERNAL Term TermContext; +X_API EXTERNAL Atom AtomCputime; +X_API EXTERNAL Term TermCputime; +X_API EXTERNAL Atom AtomCreate; +X_API EXTERNAL Term TermCreate; +X_API EXTERNAL Atom AtomCreep; +X_API EXTERNAL Term TermCreep; +X_API EXTERNAL Atom AtomCryptAtoms; +X_API EXTERNAL Term TermCryptAtoms; +X_API EXTERNAL Atom AtomCurly; +X_API EXTERNAL Term TermCurly; +X_API EXTERNAL Atom AtomCsult; +X_API EXTERNAL Term TermCsult; +X_API EXTERNAL Atom AtomCurrentModule; +X_API EXTERNAL Term TermCurrentModule; +X_API EXTERNAL Atom AtomCut; +X_API EXTERNAL Term TermCut; +X_API EXTERNAL Atom AtomCutBy; +X_API EXTERNAL Term TermCutBy; +X_API EXTERNAL Atom AtomDAbort; +X_API EXTERNAL Term TermDAbort; +X_API EXTERNAL Atom AtomDBLoad; +X_API EXTERNAL Term TermDBLoad; +X_API EXTERNAL Atom AtomDBREF; +X_API EXTERNAL Term TermDBREF; +X_API EXTERNAL Atom AtomDBReference; +X_API EXTERNAL Term TermDBReference; +X_API EXTERNAL Atom AtomDBTerm; +X_API EXTERNAL Term TermDBTerm; +X_API EXTERNAL Atom AtomDBref; +X_API EXTERNAL Term TermDBref; +X_API EXTERNAL Atom AtomDInteger; +X_API EXTERNAL Term TermDInteger; +X_API EXTERNAL Atom AtomDebugMeta; +X_API EXTERNAL Term TermDebugMeta; +X_API EXTERNAL Atom AtomDebuggerInput; +X_API EXTERNAL Term TermDebuggerInput; +X_API EXTERNAL Atom AtomDec10; +X_API EXTERNAL Term TermDec10; +X_API EXTERNAL Atom AtomDefault; +X_API EXTERNAL Term TermDefault; +X_API EXTERNAL Atom AtomDevNull; +X_API EXTERNAL Term TermDevNull; +X_API EXTERNAL Atom AtomDiff; +X_API EXTERNAL Term TermDiff; +X_API EXTERNAL Atom AtomDirectory; +X_API EXTERNAL Term TermDirectory; +X_API EXTERNAL Atom AtomDiscontiguous; +X_API EXTERNAL Term TermDiscontiguous; +X_API EXTERNAL Atom AtomDiscontiguousWarnings; +X_API EXTERNAL Term TermDiscontiguousWarnings; +X_API EXTERNAL Atom AtomDollar; +X_API EXTERNAL Term TermDollar; +X_API EXTERNAL Atom AtomDoLogUpdClause; +X_API EXTERNAL Term TermDoLogUpdClause; +X_API EXTERNAL Atom AtomDoLogUpdClause0; +X_API EXTERNAL Term TermDoLogUpdClause0; +X_API EXTERNAL Atom AtomDoLogUpdClauseErase; +X_API EXTERNAL Term TermDoLogUpdClauseErase; +X_API EXTERNAL Atom AtomDollarU; +X_API EXTERNAL Term TermDollarU; +X_API EXTERNAL Atom AtomDollarUndef; +X_API EXTERNAL Term TermDollarUndef; +X_API EXTERNAL Atom AtomDomainError; +X_API EXTERNAL Term TermDomainError; +X_API EXTERNAL Atom AtomDoStaticClause; +X_API EXTERNAL Term TermDoStaticClause; +X_API EXTERNAL Atom AtomDots; +X_API EXTERNAL Term TermDots; +X_API EXTERNAL Atom AtomDOUBLE; +X_API EXTERNAL Term TermDOUBLE; +X_API EXTERNAL Atom AtomDoubleSlash; +X_API EXTERNAL Term TermDoubleSlash; +X_API EXTERNAL Atom AtomE; +X_API EXTERNAL Term TermE; +X_API EXTERNAL Atom AtomEOFBeforeEOT; +X_API EXTERNAL Term TermEOFBeforeEOT; +X_API EXTERNAL Atom AtomEQ; +X_API EXTERNAL Term TermEQ; +X_API EXTERNAL Atom AtomEmptyAtom; +X_API EXTERNAL Term TermEmptyAtom; +X_API EXTERNAL Atom AtomEncoding; +X_API EXTERNAL Term TermEncoding; +X_API EXTERNAL Atom AtomEndOfStream; +X_API EXTERNAL Term TermEndOfStream; +X_API EXTERNAL Atom AtomEof; +X_API EXTERNAL Term TermEof; +X_API EXTERNAL Atom AtomEOfCode; +X_API EXTERNAL Term TermEOfCode; +X_API EXTERNAL Atom AtomEq; +X_API EXTERNAL Term TermEq; +X_API EXTERNAL Atom AtomError; +X_API EXTERNAL Term TermError; +X_API EXTERNAL Atom AtomException; +X_API EXTERNAL Term TermException; +X_API EXTERNAL Atom AtomExtensions; +X_API EXTERNAL Term TermExtensions; +X_API EXTERNAL Atom AtomEvaluable; +X_API EXTERNAL Term TermEvaluable; +X_API EXTERNAL Atom AtomEvaluationError; +X_API EXTERNAL Term TermEvaluationError; +X_API EXTERNAL Atom AtomExecutable; +X_API EXTERNAL Term TermExecutable; +X_API EXTERNAL Atom AtomExecute; +X_API EXTERNAL Term TermExecute; +X_API EXTERNAL Atom AtomExecAnswers; +X_API EXTERNAL Term TermExecAnswers; +X_API EXTERNAL Atom AtomExecuteInMod; +X_API EXTERNAL Term TermExecuteInMod; +X_API EXTERNAL Atom AtomExecuteWithin; +X_API EXTERNAL Term TermExecuteWithin; +X_API EXTERNAL Atom AtomExecuteWoMod; +X_API EXTERNAL Term TermExecuteWoMod; +X_API EXTERNAL Atom AtomExist; +X_API EXTERNAL Term TermExist; +X_API EXTERNAL Atom AtomExists; +X_API EXTERNAL Term TermExists; +X_API EXTERNAL Atom AtomExit; +X_API EXTERNAL Term TermExit; +X_API EXTERNAL Atom AtomExistenceError; +X_API EXTERNAL Term TermExistenceError; +X_API EXTERNAL Atom AtomExoClause; +X_API EXTERNAL Term TermExoClause; +X_API EXTERNAL Atom AtomExpectedNumber; +X_API EXTERNAL Term TermExpectedNumber; +X_API EXTERNAL Atom AtomExpand; +X_API EXTERNAL Term TermExpand; +X_API EXTERNAL Atom AtomExtendFileSearchPath; +X_API EXTERNAL Term TermExtendFileSearchPath; +X_API EXTERNAL Atom AtomExtendsions; +X_API EXTERNAL Term TermExtendsions; +X_API EXTERNAL Atom AtomFB; +X_API EXTERNAL Term TermFB; +X_API EXTERNAL Atom AtomFail; +X_API EXTERNAL Term TermFail; +X_API EXTERNAL Atom AtomFalse; +X_API EXTERNAL Term TermFalse; +X_API EXTERNAL Atom AtomFast; +X_API EXTERNAL Term TermFast; +X_API EXTERNAL Atom AtomFastFail; +X_API EXTERNAL Term TermFastFail; +X_API EXTERNAL Atom AtomFileErrors; +X_API EXTERNAL Term TermFileErrors; +X_API EXTERNAL Atom AtomFileerrors; +X_API EXTERNAL Term TermFileerrors; +X_API EXTERNAL Atom AtomFileType; +X_API EXTERNAL Term TermFileType; +X_API EXTERNAL Atom AtomFirst; +X_API EXTERNAL Term TermFirst; +X_API EXTERNAL Atom AtomFloat; +X_API EXTERNAL Term TermFloat; +X_API EXTERNAL Atom AtomFloatFormat; +X_API EXTERNAL Term TermFloatFormat; +X_API EXTERNAL Atom AtomFloatOverflow; +X_API EXTERNAL Term TermFloatOverflow; +X_API EXTERNAL Atom AtomFloatUnderflow; +X_API EXTERNAL Term TermFloatUnderflow; +X_API EXTERNAL Atom AtomFormat; +X_API EXTERNAL Term TermFormat; +X_API EXTERNAL Atom AtomFormatAt; +X_API EXTERNAL Term TermFormatAt; +X_API EXTERNAL Atom AtomFull; +X_API EXTERNAL Term TermFull; +X_API EXTERNAL Atom AtomFunctor; +X_API EXTERNAL Term TermFunctor; +X_API EXTERNAL Atom AtomGT; +X_API EXTERNAL Term TermGT; +X_API EXTERNAL Atom AtomGVar; +X_API EXTERNAL Term TermGVar; +X_API EXTERNAL Atom AtomGc; +X_API EXTERNAL Term TermGc; +X_API EXTERNAL Atom AtomGcMargin; +X_API EXTERNAL Term TermGcMargin; +X_API EXTERNAL Atom AtomGcTrace; +X_API EXTERNAL Term TermGcTrace; +X_API EXTERNAL Atom AtomGcVerbose; +X_API EXTERNAL Term TermGcVerbose; +X_API EXTERNAL Atom AtomGcVeryVerbose; +X_API EXTERNAL Term TermGcVeryVerbose; +X_API EXTERNAL Atom AtomGeneratePredInfo; +X_API EXTERNAL Term TermGeneratePredInfo; +X_API EXTERNAL Atom AtomGetwork; +X_API EXTERNAL Term TermGetwork; +X_API EXTERNAL Atom AtomGetworkSeq; +X_API EXTERNAL Term TermGetworkSeq; +X_API EXTERNAL Atom AtomGlob; +X_API EXTERNAL Term TermGlob; +X_API EXTERNAL Atom AtomGlobal; +X_API EXTERNAL Term TermGlobal; +X_API EXTERNAL Atom AtomGlobalSp; +X_API EXTERNAL Term TermGlobalSp; +X_API EXTERNAL Atom AtomGlobalTrie; +X_API EXTERNAL Term TermGlobalTrie; +X_API EXTERNAL Atom AtomGoalExpansion; +X_API EXTERNAL Term TermGoalExpansion; +X_API EXTERNAL Atom AtomHat; +X_API EXTERNAL Term TermHat; +X_API EXTERNAL Atom AtomHERE; +X_API EXTERNAL Term TermHERE; +X_API EXTERNAL Atom AtomHandleThrow; +X_API EXTERNAL Term TermHandleThrow; +X_API EXTERNAL Atom AtomHeap; +X_API EXTERNAL Term TermHeap; +X_API EXTERNAL Atom AtomHeapUsed; +X_API EXTERNAL Term TermHeapUsed; +X_API EXTERNAL Atom AtomHugeInt; +X_API EXTERNAL Term TermHugeInt; +X_API EXTERNAL Atom AtomIDB; +X_API EXTERNAL Term TermIDB; +X_API EXTERNAL Atom AtomIOMode; +X_API EXTERNAL Term TermIOMode; +X_API EXTERNAL Atom AtomI; +X_API EXTERNAL Term TermI; +X_API EXTERNAL Atom AtomId; +X_API EXTERNAL Term TermId; +X_API EXTERNAL Atom AtomIgnore; +X_API EXTERNAL Term TermIgnore; +X_API EXTERNAL Atom AtomInf; +X_API EXTERNAL Term TermInf; +X_API EXTERNAL Atom AtomInfinity; +X_API EXTERNAL Term TermInfinity; +X_API EXTERNAL Atom AtomInfo; +X_API EXTERNAL Term TermInfo; +X_API EXTERNAL Atom AtomInitGoal; +X_API EXTERNAL Term TermInitGoal; +X_API EXTERNAL Atom AtomInitProlog; +X_API EXTERNAL Term TermInitProlog; +X_API EXTERNAL Atom AtomInStackExpansion; +X_API EXTERNAL Term TermInStackExpansion; +X_API EXTERNAL Atom AtomInput; +X_API EXTERNAL Term TermInput; +X_API EXTERNAL Atom AtomInstantiationError; +X_API EXTERNAL Term TermInstantiationError; +X_API EXTERNAL Atom AtomInt; +X_API EXTERNAL Term TermInt; +X_API EXTERNAL Atom AtomIntOverflow; +X_API EXTERNAL Term TermIntOverflow; +X_API EXTERNAL Atom AtomInteger; +X_API EXTERNAL Term TermInteger; +X_API EXTERNAL Atom AtomInternalCompilerError; +X_API EXTERNAL Term TermInternalCompilerError; +X_API EXTERNAL Atom AtomIs; +X_API EXTERNAL Term TermIs; +X_API EXTERNAL Atom AtomJ; +X_API EXTERNAL Term TermJ; +X_API EXTERNAL Atom Atoml; +X_API EXTERNAL Term Terml; +X_API EXTERNAL Atom AtomKey; +X_API EXTERNAL Term TermKey; +X_API EXTERNAL Atom AtomLDLibraryPath; +X_API EXTERNAL Term TermLDLibraryPath; +X_API EXTERNAL Atom AtomLONGINT; +X_API EXTERNAL Term TermLONGINT; +X_API EXTERNAL Atom AtomLOOP; +X_API EXTERNAL Term TermLOOP; +X_API EXTERNAL Atom AtomLoopStream; +X_API EXTERNAL Term TermLoopStream; +X_API EXTERNAL Atom AtomLT; +X_API EXTERNAL Term TermLT; +X_API EXTERNAL Atom AtomLastExecuteWithin; +X_API EXTERNAL Term TermLastExecuteWithin; +X_API EXTERNAL Atom AtomLeash; +X_API EXTERNAL Term TermLeash; +X_API EXTERNAL Atom AtomLeast; +X_API EXTERNAL Term TermLeast; +X_API EXTERNAL Atom AtomLength; +X_API EXTERNAL Term TermLength; +X_API EXTERNAL Atom AtomList; +X_API EXTERNAL Term TermList; +X_API EXTERNAL Atom AtomLine; +X_API EXTERNAL Term TermLine; +X_API EXTERNAL Atom AtomLive; +X_API EXTERNAL Term TermLive; +X_API EXTERNAL Atom AtomLoadAnswers; +X_API EXTERNAL Term TermLoadAnswers; +X_API EXTERNAL Atom AtomLocal; +X_API EXTERNAL Term TermLocal; +X_API EXTERNAL Atom AtomLocalSp; +X_API EXTERNAL Term TermLocalSp; +X_API EXTERNAL Atom AtomLocalTrie; +X_API EXTERNAL Term TermLocalTrie; +X_API EXTERNAL Atom AtomMax; +X_API EXTERNAL Term TermMax; +X_API EXTERNAL Atom AtomMaximum; +X_API EXTERNAL Term TermMaximum; +X_API EXTERNAL Atom AtomMaxArity; +X_API EXTERNAL Term TermMaxArity; +X_API EXTERNAL Atom AtomMaxFiles; +X_API EXTERNAL Term TermMaxFiles; +X_API EXTERNAL Atom AtomMegaClause; +X_API EXTERNAL Term TermMegaClause; +X_API EXTERNAL Atom AtomMetaCall; +X_API EXTERNAL Term TermMetaCall; +X_API EXTERNAL Atom AtomMfClause; +X_API EXTERNAL Term TermMfClause; +X_API EXTERNAL Atom AtomMin; +X_API EXTERNAL Term TermMin; +X_API EXTERNAL Atom AtomMinimum; +X_API EXTERNAL Term TermMinimum; +X_API EXTERNAL Atom AtomMinus; +X_API EXTERNAL Term TermMinus; +X_API EXTERNAL Atom AtomModify; +X_API EXTERNAL Term TermModify; +X_API EXTERNAL Atom AtomModule; +X_API EXTERNAL Term TermModule; +X_API EXTERNAL Atom AtomMost; +X_API EXTERNAL Term TermMost; +X_API EXTERNAL Atom AtomMulti; +X_API EXTERNAL Term TermMulti; +X_API EXTERNAL Atom AtomMultiFile; +X_API EXTERNAL Term TermMultiFile; +X_API EXTERNAL Atom AtomMultiple; +X_API EXTERNAL Term TermMultiple; +X_API EXTERNAL Atom AtomMutable; +X_API EXTERNAL Term TermMutable; +X_API EXTERNAL Atom AtomMutableVariable; +X_API EXTERNAL Term TermMutableVariable; +X_API EXTERNAL Atom AtomMutex; +X_API EXTERNAL Term TermMutex; +X_API EXTERNAL Atom AtomMyddasDB; +X_API EXTERNAL Term TermMyddasDB; +X_API EXTERNAL Atom AtomMyddasGoal; +X_API EXTERNAL Term TermMyddasGoal; +X_API EXTERNAL Atom AtomMyddasHost; +X_API EXTERNAL Term TermMyddasHost; +X_API EXTERNAL Atom AtomMyddasPass; +X_API EXTERNAL Term TermMyddasPass; +X_API EXTERNAL Atom AtomMyddasUser; +X_API EXTERNAL Term TermMyddasUser; +X_API EXTERNAL Atom AtomMyddasVersionName; +X_API EXTERNAL Term TermMyddasVersionName; +X_API EXTERNAL Atom AtomNan; +X_API EXTERNAL Term TermNan; +X_API EXTERNAL Atom AtomNb; +X_API EXTERNAL Term TermNb; +X_API EXTERNAL Atom AtomNbTerm; +X_API EXTERNAL Term TermNbTerm; +X_API EXTERNAL Atom AtomNew; +X_API EXTERNAL Term TermNew; +X_API EXTERNAL Atom AtomNewLine; +X_API EXTERNAL Term TermNewLine; +X_API EXTERNAL Atom AtomNl; +X_API EXTERNAL Term TermNl; +X_API EXTERNAL Atom AtomNoEffect; +X_API EXTERNAL Term TermNoEffect; +X_API EXTERNAL Atom AtomNoMemory; +X_API EXTERNAL Term TermNoMemory; +X_API EXTERNAL Atom AtomNone; +X_API EXTERNAL Term TermNone; +X_API EXTERNAL Atom AtomNonEmptyList; +X_API EXTERNAL Term TermNonEmptyList; +X_API EXTERNAL Atom AtomNot; +X_API EXTERNAL Term TermNot; +X_API EXTERNAL Atom AtomNotImplemented; +X_API EXTERNAL Term TermNotImplemented; +X_API EXTERNAL Atom AtomNotLessThanZero; +X_API EXTERNAL Term TermNotLessThanZero; +X_API EXTERNAL Atom AtomNotNewline; +X_API EXTERNAL Term TermNotNewline; +X_API EXTERNAL Atom AtomNotZero; +X_API EXTERNAL Term TermNotZero; +X_API EXTERNAL Atom AtomNumber; +X_API EXTERNAL Term TermNumber; +X_API EXTERNAL Atom AtomObj; +X_API EXTERNAL Term TermObj; +X_API EXTERNAL Atom AtomOff; +X_API EXTERNAL Term TermOff; +X_API EXTERNAL Atom AtomOffline; +X_API EXTERNAL Term TermOffline; +X_API EXTERNAL Atom AtomOn; +X_API EXTERNAL Term TermOn; +X_API EXTERNAL Atom AtomOnline; +X_API EXTERNAL Term TermOnline; +X_API EXTERNAL Atom AtomOpen; +X_API EXTERNAL Term TermOpen; +X_API EXTERNAL Atom AtomOperatingSystemError; +X_API EXTERNAL Term TermOperatingSystemError; +X_API EXTERNAL Atom AtomOperatingSystemSupport; +X_API EXTERNAL Term TermOperatingSystemSupport; +X_API EXTERNAL Atom AtomOperator; +X_API EXTERNAL Term TermOperator; +X_API EXTERNAL Atom AtomOperatorPriority; +X_API EXTERNAL Term TermOperatorPriority; +X_API EXTERNAL Atom AtomOperatorSpecifier; +X_API EXTERNAL Term TermOperatorSpecifier; +X_API EXTERNAL Atom AtomOpt; +X_API EXTERNAL Term TermOpt; +X_API EXTERNAL Atom AtomOtherwise; +X_API EXTERNAL Term TermOtherwise; +X_API EXTERNAL Atom AtomOutOfAttvarsError; +X_API EXTERNAL Term TermOutOfAttvarsError; +X_API EXTERNAL Atom AtomOutOfAuxspaceError; +X_API EXTERNAL Term TermOutOfAuxspaceError; +X_API EXTERNAL Atom AtomOutOfHeapError; +X_API EXTERNAL Term TermOutOfHeapError; +X_API EXTERNAL Atom AtomOutOfRange; +X_API EXTERNAL Term TermOutOfRange; +X_API EXTERNAL Atom AtomOutOfStackError; +X_API EXTERNAL Term TermOutOfStackError; +X_API EXTERNAL Atom AtomOutOfTrailError; +X_API EXTERNAL Term TermOutOfTrailError; +X_API EXTERNAL Atom AtomOutput; +X_API EXTERNAL Term TermOutput; +X_API EXTERNAL Atom AtomParameter; +X_API EXTERNAL Term TermParameter; +X_API EXTERNAL Atom AtomPrologCommonsDir; +X_API EXTERNAL Term TermPrologCommonsDir; +X_API EXTERNAL Atom AtomPast; +X_API EXTERNAL Term TermPast; +X_API EXTERNAL Atom AtomPastEndOfStream; +X_API EXTERNAL Term TermPastEndOfStream; +X_API EXTERNAL Atom AtomPermissionError; +X_API EXTERNAL Term TermPermissionError; +X_API EXTERNAL Atom AtomPi; +X_API EXTERNAL Term TermPi; +X_API EXTERNAL Atom AtomPipe; +X_API EXTERNAL Term TermPipe; +X_API EXTERNAL Atom AtomPriority; +X_API EXTERNAL Term TermPriority; +X_API EXTERNAL Atom AtomPlus; +X_API EXTERNAL Term TermPlus; +X_API EXTERNAL Atom AtomPointer; +X_API EXTERNAL Term TermPointer; +X_API EXTERNAL Atom AtomPortray; +X_API EXTERNAL Term TermPortray; +X_API EXTERNAL Atom AtomPredicateIndicator; +X_API EXTERNAL Term TermPredicateIndicator; +X_API EXTERNAL Atom AtomPrimitive; +X_API EXTERNAL Term TermPrimitive; +X_API EXTERNAL Atom AtomPrintMessage; +X_API EXTERNAL Term TermPrintMessage; +X_API EXTERNAL Atom AtomPrivateProcedure; +X_API EXTERNAL Term TermPrivateProcedure; +X_API EXTERNAL Atom AtomProcedure; +X_API EXTERNAL Term TermProcedure; +X_API EXTERNAL Atom AtomProfile; +X_API EXTERNAL Term TermProfile; +X_API EXTERNAL Atom AtomProlog; +X_API EXTERNAL Term TermProlog; +X_API EXTERNAL Atom AtomProtectStack; +X_API EXTERNAL Term TermProtectStack; +X_API EXTERNAL Atom AtomQly; +X_API EXTERNAL Term TermQly; +X_API EXTERNAL Atom AtomQuery; +X_API EXTERNAL Term TermQuery; +X_API EXTERNAL Atom AtomQueue; +X_API EXTERNAL Term TermQueue; +X_API EXTERNAL Atom AtomQuiet; +X_API EXTERNAL Term TermQuiet; +X_API EXTERNAL Atom AtomRadix; +X_API EXTERNAL Term TermRadix; +X_API EXTERNAL Atom AtomRandom; +X_API EXTERNAL Term TermRandom; +X_API EXTERNAL Atom AtomRange; +X_API EXTERNAL Term TermRange; +X_API EXTERNAL Atom AtomRDiv; +X_API EXTERNAL Term TermRDiv; +X_API EXTERNAL Atom AtomRead; +X_API EXTERNAL Term TermRead; +X_API EXTERNAL Atom AtomReadOnly; +X_API EXTERNAL Term TermReadOnly; +X_API EXTERNAL Atom AtomReadWrite; +X_API EXTERNAL Term TermReadWrite; +X_API EXTERNAL Atom AtomReadutil; +X_API EXTERNAL Term TermReadutil; +X_API EXTERNAL Atom AtomReconsult; +X_API EXTERNAL Term TermReconsult; +X_API EXTERNAL Atom AtomRecordedP; +X_API EXTERNAL Term TermRecordedP; +X_API EXTERNAL Atom AtomRecordedWithKey; +X_API EXTERNAL Term TermRecordedWithKey; +X_API EXTERNAL Atom AtomRedefineWarnings; +X_API EXTERNAL Term TermRedefineWarnings; +X_API EXTERNAL Atom AtomRedoFreeze; +X_API EXTERNAL Term TermRedoFreeze; +X_API EXTERNAL Atom AtomRefoundVar; +X_API EXTERNAL Term TermRefoundVar; +X_API EXTERNAL Atom AtomRelativeTo; +X_API EXTERNAL Term TermRelativeTo; +X_API EXTERNAL Atom AtomRepeat; +X_API EXTERNAL Term TermRepeat; +X_API EXTERNAL Atom AtomRepeatSpace; +X_API EXTERNAL Term TermRepeatSpace; +X_API EXTERNAL Atom AtomReposition; +X_API EXTERNAL Term TermReposition; +X_API EXTERNAL Atom AtomRepresentationError; +X_API EXTERNAL Term TermRepresentationError; +X_API EXTERNAL Atom AtomReset; +X_API EXTERNAL Term TermReset; +X_API EXTERNAL Atom AtomResize; +X_API EXTERNAL Term TermResize; +X_API EXTERNAL Atom AtomResourceError; +X_API EXTERNAL Term TermResourceError; +X_API EXTERNAL Atom AtomRestoreRegs; +X_API EXTERNAL Term TermRestoreRegs; +X_API EXTERNAL Atom AtomRetry; +X_API EXTERNAL Term TermRetry; +X_API EXTERNAL Atom AtomRetryCounter; +X_API EXTERNAL Term TermRetryCounter; +X_API EXTERNAL Atom AtomRTree; +X_API EXTERNAL Term TermRTree; +X_API EXTERNAL Atom AtomSafe; +X_API EXTERNAL Term TermSafe; +X_API EXTERNAL Atom AtomSafeCallCleanup; +X_API EXTERNAL Term TermSafeCallCleanup; +X_API EXTERNAL Atom AtomSame; +X_API EXTERNAL Term TermSame; +X_API EXTERNAL Atom AtomSemic; +X_API EXTERNAL Term TermSemic; +X_API EXTERNAL Atom AtomShiftCountOverflow; +X_API EXTERNAL Term TermShiftCountOverflow; +X_API EXTERNAL Atom AtomSigAlarm; +X_API EXTERNAL Term TermSigAlarm; +X_API EXTERNAL Atom AtomSigBreak; +X_API EXTERNAL Term TermSigBreak; +X_API EXTERNAL Atom AtomSigCreep; +X_API EXTERNAL Term TermSigCreep; +X_API EXTERNAL Atom AtomSigDebug; +X_API EXTERNAL Term TermSigDebug; +X_API EXTERNAL Atom AtomSigDelayCreep; +X_API EXTERNAL Term TermSigDelayCreep; +X_API EXTERNAL Atom AtomSigFPE; +X_API EXTERNAL Term TermSigFPE; +X_API EXTERNAL Atom AtomSigHup; +X_API EXTERNAL Term TermSigHup; +X_API EXTERNAL Atom AtomSigInt; +X_API EXTERNAL Term TermSigInt; +X_API EXTERNAL Atom AtomSigIti; +X_API EXTERNAL Term TermSigIti; +X_API EXTERNAL Atom AtomSigPending; +X_API EXTERNAL Term TermSigPending; +X_API EXTERNAL Atom AtomSigPipe; +X_API EXTERNAL Term TermSigPipe; +X_API EXTERNAL Atom AtomSigStackDump; +X_API EXTERNAL Term TermSigStackDump; +X_API EXTERNAL Atom AtomSigStatistics; +X_API EXTERNAL Term TermSigStatistics; +X_API EXTERNAL Atom AtomSigTrace; +X_API EXTERNAL Term TermSigTrace; +X_API EXTERNAL Atom AtomSigUsr1; +X_API EXTERNAL Term TermSigUsr1; +X_API EXTERNAL Atom AtomSigUsr2; +X_API EXTERNAL Term TermSigUsr2; +X_API EXTERNAL Atom AtomSigVTAlarm; +X_API EXTERNAL Term TermSigVTAlarm; +X_API EXTERNAL Atom AtomSigWakeUp; +X_API EXTERNAL Term TermSigWakeUp; +X_API EXTERNAL Atom AtomSilent; +X_API EXTERNAL Term TermSilent; +X_API EXTERNAL Atom AtomSingle; +X_API EXTERNAL Term TermSingle; +X_API EXTERNAL Atom AtomSingleVarWarnings; +X_API EXTERNAL Term TermSingleVarWarnings; +X_API EXTERNAL Atom AtomSingleton; +X_API EXTERNAL Term TermSingleton; +X_API EXTERNAL Atom AtomSlash; +X_API EXTERNAL Term TermSlash; +X_API EXTERNAL Atom AtomSocket; +X_API EXTERNAL Term TermSocket; +X_API EXTERNAL Atom AtomSolutions; +X_API EXTERNAL Term TermSolutions; +X_API EXTERNAL Atom AtomSource; +X_API EXTERNAL Term TermSource; +X_API EXTERNAL Atom AtomSourceSink; +X_API EXTERNAL Term TermSourceSink; +X_API EXTERNAL Atom AtomSpy; +X_API EXTERNAL Term TermSpy; +X_API EXTERNAL Atom AtomStack; +X_API EXTERNAL Term TermStack; +X_API EXTERNAL Atom AtomStackFree; +X_API EXTERNAL Term TermStackFree; +X_API EXTERNAL Atom AtomStartupSavedState; +X_API EXTERNAL Term TermStartupSavedState; +X_API EXTERNAL Atom AtomStaticClause; +X_API EXTERNAL Term TermStaticClause; +X_API EXTERNAL Atom AtomStaticProcedure; +X_API EXTERNAL Term TermStaticProcedure; +X_API EXTERNAL Atom AtomStream; +X_API EXTERNAL Term TermStream; +X_API EXTERNAL Atom AtomSWIStream; +X_API EXTERNAL Term TermSWIStream; +X_API EXTERNAL Atom AtomVStream; +X_API EXTERNAL Term TermVStream; +X_API EXTERNAL Atom AtomStreams; +X_API EXTERNAL Term TermStreams; +X_API EXTERNAL Atom AtomStreamOrAlias; +X_API EXTERNAL Term TermStreamOrAlias; +X_API EXTERNAL Atom AtomStreamPos; +X_API EXTERNAL Term TermStreamPos; +X_API EXTERNAL Atom AtomStreamPosition; +X_API EXTERNAL Term TermStreamPosition; +X_API EXTERNAL Atom AtomString; +X_API EXTERNAL Term TermString; +X_API EXTERNAL Atom AtomStyleCheck; +X_API EXTERNAL Term TermStyleCheck; +X_API EXTERNAL Atom AtomSTRING; +X_API EXTERNAL Term TermSTRING; +X_API EXTERNAL Atom AtomSwi; +X_API EXTERNAL Term TermSwi; +X_API EXTERNAL Atom AtomSymbolChar; +X_API EXTERNAL Term TermSymbolChar; +X_API EXTERNAL Atom AtomSyntaxError; +X_API EXTERNAL Term TermSyntaxError; +X_API EXTERNAL Atom AtomSyntaxErrors; +X_API EXTERNAL Term TermSyntaxErrors; +X_API EXTERNAL Atom AtomSyntaxErrorHandler; +X_API EXTERNAL Term TermSyntaxErrorHandler; +X_API EXTERNAL Atom AtomSystem; +X_API EXTERNAL Term TermSystem; +X_API EXTERNAL Atom AtomSystemError; +X_API EXTERNAL Term TermSystemError; +X_API EXTERNAL Atom AtomSystemLibraryDir; +X_API EXTERNAL Term TermSystemLibraryDir; +X_API EXTERNAL Atom AtomT; +X_API EXTERNAL Term TermT; +X_API EXTERNAL Atom AtomTerm; +X_API EXTERNAL Term TermTerm; +X_API EXTERNAL Atom AtomTermExpansion; +X_API EXTERNAL Term TermTermExpansion; +X_API EXTERNAL Atom AtomTerms; +X_API EXTERNAL Term TermTerms; +X_API EXTERNAL Atom AtomText; +X_API EXTERNAL Term TermText; +X_API EXTERNAL Atom AtomTextStream; +X_API EXTERNAL Term TermTextStream; +X_API EXTERNAL Atom AtomThread; +X_API EXTERNAL Term TermThread; +X_API EXTERNAL Atom AtomThreads; +X_API EXTERNAL Term TermThreads; +X_API EXTERNAL Atom AtomThrow; +X_API EXTERNAL Term TermThrow; +X_API EXTERNAL Atom AtomTimeOutSpec; +X_API EXTERNAL Term TermTimeOutSpec; +X_API EXTERNAL Atom AtomTimeoutError; +X_API EXTERNAL Term TermTimeoutError; +X_API EXTERNAL Atom AtomTopLevelGoal; +X_API EXTERNAL Term TermTopLevelGoal; +X_API EXTERNAL Atom AtomTopThreadGoal; +X_API EXTERNAL Term TermTopThreadGoal; +X_API EXTERNAL Atom AtomTraceMetaCall; +X_API EXTERNAL Term TermTraceMetaCall; +X_API EXTERNAL Atom AtomTrail; +X_API EXTERNAL Atom AtomTrue; +X_API EXTERNAL Term TermTrue; +X_API EXTERNAL Atom AtomTty; +X_API EXTERNAL Term TermTty; +X_API EXTERNAL Atom AtomTtys; +X_API EXTERNAL Term TermTtys; +X_API EXTERNAL Atom AtomTuple; +X_API EXTERNAL Term TermTuple; +X_API EXTERNAL Atom AtomTxt; +X_API EXTERNAL Term TermTxt; +X_API EXTERNAL Atom AtomTypeError; +X_API EXTERNAL Term TermTypeError; +X_API EXTERNAL Atom AtomUndefined; +X_API EXTERNAL Term TermUndefined; +X_API EXTERNAL Atom AtomUndefp; +X_API EXTERNAL Term TermUndefp; +X_API EXTERNAL Atom AtomUndefp0; +X_API EXTERNAL Term TermUndefp0; +X_API EXTERNAL Atom AtomUnderflow; +X_API EXTERNAL Term TermUnderflow; +X_API EXTERNAL Atom AtomUnificationStack; +X_API EXTERNAL Term TermUnificationStack; +X_API EXTERNAL Atom AtomUnique; +X_API EXTERNAL Term TermUnique; +X_API EXTERNAL Atom AtomUnsignedByte; +X_API EXTERNAL Term TermUnsignedByte; +X_API EXTERNAL Atom AtomUnsignedChar; +X_API EXTERNAL Term TermUnsignedChar; +X_API EXTERNAL Atom AtomUser; +X_API EXTERNAL Term TermUser; +X_API EXTERNAL Atom AtomUserErr; +X_API EXTERNAL Term TermUserErr; +X_API EXTERNAL Atom AtomUserIn; +X_API EXTERNAL Term TermUserIn; +X_API EXTERNAL Atom AtomUserOut; +X_API EXTERNAL Term TermUserOut; +X_API EXTERNAL Atom AtomDollarVar; +X_API EXTERNAL Term TermDollarVar; +X_API EXTERNAL Atom AtomVBar; +X_API EXTERNAL Term TermVBar; +X_API EXTERNAL Atom AtomVarBranches; +X_API EXTERNAL Term TermVarBranches; +X_API EXTERNAL Atom AtomVariableNames; +X_API EXTERNAL Term TermVariableNames; +X_API EXTERNAL Atom AtomHiddenVar; +X_API EXTERNAL Term TermHiddenVar; +X_API EXTERNAL Atom AtomVariable; +X_API EXTERNAL Term TermVariable; +X_API EXTERNAL Atom AtomVerbose; +X_API EXTERNAL Term TermVerbose; +X_API EXTERNAL Atom AtomVerboseFileSearch; +X_API EXTERNAL Term TermVerboseFileSearch; +X_API EXTERNAL Atom AtomVersionNumber; +X_API EXTERNAL Term TermVersionNumber; +X_API EXTERNAL Atom AtomVeryVerbose; +X_API EXTERNAL Term TermVeryVerbose; +X_API EXTERNAL Atom AtomWakeUpGoal; +X_API EXTERNAL Term TermWakeUpGoal; +X_API EXTERNAL Atom AtomWarning; +X_API EXTERNAL Term TermWarning; +X_API EXTERNAL Atom AtomWhen; +X_API EXTERNAL Term TermWhen; +X_API EXTERNAL Atom AtomWrite; +X_API EXTERNAL Term TermWrite; +X_API EXTERNAL Atom AtomWriteTerm; +X_API EXTERNAL Term TermWriteTerm; +X_API EXTERNAL Atom AtomXml; +X_API EXTERNAL Term TermXml; +X_API EXTERNAL Atom AtomYapHacks; +X_API EXTERNAL Term TermYapHacks; +X_API EXTERNAL Atom AtomZeroDivisor; +X_API EXTERNAL Term TermZeroDivisor; +X_API EXTERNAL Functor FunctorAfInet; + +X_API EXTERNAL Functor FunctorAfLocal; + +X_API EXTERNAL Functor FunctorAfUnix; + +X_API EXTERNAL Functor FunctorAltNot; + +X_API EXTERNAL Functor FunctorArg; + +X_API EXTERNAL Functor FunctorArrayEntry; + +X_API EXTERNAL Functor FunctorArrow; + +X_API EXTERNAL Functor FunctorDoubleArrow; + +X_API EXTERNAL Functor FunctorAssert1; + +X_API EXTERNAL Functor FunctorAssert; + +X_API EXTERNAL Functor FunctorAtFoundOne; + +X_API EXTERNAL Functor FunctorAtom; + +X_API EXTERNAL Functor FunctorAtt1; + +X_API EXTERNAL Functor FunctorAttGoal; + +X_API EXTERNAL Functor FunctorBraces; + +X_API EXTERNAL Functor FunctorCall; + +X_API EXTERNAL Functor FunctorCatch; + +X_API EXTERNAL Functor FunctorChangeModule; + +X_API EXTERNAL Functor FunctorChars; + +X_API EXTERNAL Functor FunctorChars1; + +X_API EXTERNAL Functor FunctorCleanCall; + +X_API EXTERNAL Functor FunctorClist; + +X_API EXTERNAL Functor FunctorCodes; + +X_API EXTERNAL Functor FunctorCodes1; + +X_API EXTERNAL Functor FunctorColon; + +X_API EXTERNAL Functor FunctorComma; + +X_API EXTERNAL Functor FunctorCommentHook; + +X_API EXTERNAL Functor FunctorContext2; + +X_API EXTERNAL Functor FunctorConsistencyError; + +X_API EXTERNAL Functor FunctorCreep; + +X_API EXTERNAL Functor FunctorCsult; + +X_API EXTERNAL Functor FunctorCurrentModule; + +X_API EXTERNAL Functor FunctorCutBy; + +X_API EXTERNAL Functor FunctorDBREF; + +X_API EXTERNAL Functor FunctorDiff; + +X_API EXTERNAL Functor FunctorDoLogUpdClause; + +X_API EXTERNAL Functor FunctorDoLogUpdClause0; + +X_API EXTERNAL Functor FunctorDoLogUpdClauseErase; + +X_API EXTERNAL Functor FunctorDoStaticClause; + +X_API EXTERNAL Functor FunctorDollar; + +X_API EXTERNAL Functor FunctorDollarVar; + +X_API EXTERNAL Functor FunctorDomainError; + +X_API EXTERNAL Functor FunctorDot; + +X_API EXTERNAL Functor FunctorDot10; + +X_API EXTERNAL Functor FunctorDot11; + +X_API EXTERNAL Functor FunctorDot12; + +X_API EXTERNAL Functor FunctorDot2; + +X_API EXTERNAL Functor FunctorDot3; + +X_API EXTERNAL Functor FunctorDot4; + +X_API EXTERNAL Functor FunctorDot5; + +X_API EXTERNAL Functor FunctorDot6; + +X_API EXTERNAL Functor FunctorDot7; + +X_API EXTERNAL Functor FunctorDot8; + +X_API EXTERNAL Functor FunctorDot9; + +X_API EXTERNAL Functor FunctorDoubleArrow; + +X_API EXTERNAL Functor FunctorDoubleSlash; + +X_API EXTERNAL Functor FunctorEmptySquareBrackets; + +X_API EXTERNAL Functor FunctorEq; + +X_API EXTERNAL Functor FunctorError; + +X_API EXTERNAL Functor FunctorEvaluationError; + +X_API EXTERNAL Functor FunctorException; + +X_API EXTERNAL Functor FunctorExecute2InMod; + +X_API EXTERNAL Functor FunctorExecuteInMod; + +X_API EXTERNAL Functor FunctorExecuteWithin; + +X_API EXTERNAL Functor FunctorExistenceError; + +X_API EXTERNAL Functor FunctorExoClause; + +X_API EXTERNAL Functor FunctorFunctor; + +X_API EXTERNAL Functor FunctorGAtom; + +X_API EXTERNAL Functor FunctorGAtomic; + +X_API EXTERNAL Functor FunctorGCompound; + +X_API EXTERNAL Functor FunctorGFloat; + +X_API EXTERNAL Functor FunctorGFormatAt; + +X_API EXTERNAL Functor FunctorGInteger; + +X_API EXTERNAL Functor FunctorGNumber; + +X_API EXTERNAL Functor FunctorGPrimitive; + +X_API EXTERNAL Functor FunctorGVar; + +X_API EXTERNAL Functor FunctorGeneratePredInfo; + +X_API EXTERNAL Functor FunctorGoalExpansion2; + +X_API EXTERNAL Functor FunctorGoalExpansion; + +X_API EXTERNAL Functor FunctorHandleThrow; + +X_API EXTERNAL Functor FunctorHat; + +X_API EXTERNAL Functor FunctorI; + +X_API EXTERNAL Functor FunctorId; + +X_API EXTERNAL Functor FunctorInfo1; + +X_API EXTERNAL Functor FunctorInfo2; + +X_API EXTERNAL Functor FunctorInfo3; + +X_API EXTERNAL Functor FunctorInfo4; + +X_API EXTERNAL Functor FunctorIs; + +X_API EXTERNAL Functor FunctorJ; + +X_API EXTERNAL Functor FunctorLastExecuteWithin; + +X_API EXTERNAL Functor FunctorList; + +X_API EXTERNAL Functor FunctorLOOP; + +X_API EXTERNAL Functor FunctorMegaClause; + +X_API EXTERNAL Functor FunctorMetaCall; + +X_API EXTERNAL Functor FunctorMinus; + +X_API EXTERNAL Functor FunctorModule; + +X_API EXTERNAL Functor FunctorMultiFileClause; + +X_API EXTERNAL Functor FunctorMutable; + +X_API EXTERNAL Functor FunctorMutex; + +X_API EXTERNAL Functor FunctorNotImplemented; + +X_API EXTERNAL Functor FunctorNBQueue; + +X_API EXTERNAL Functor FunctorNot; + +X_API EXTERNAL Functor FunctorObj; + +X_API EXTERNAL Functor FunctorOr; + +X_API EXTERNAL Functor FunctorOutput; + +X_API EXTERNAL Functor FunctorPermissionError; + +X_API EXTERNAL Functor FunctorPlus; + +X_API EXTERNAL Functor FunctorPortray; + +X_API EXTERNAL Functor FunctorPrintMessage; + +X_API EXTERNAL Functor FunctorProcedure; + +X_API EXTERNAL Functor FunctorPriority; + +X_API EXTERNAL Functor FunctorPrologConstraint; + +X_API EXTERNAL Functor FunctorProtectStack; + +X_API EXTERNAL Functor FunctorQuery; + +X_API EXTERNAL Functor FunctorRecordedWithKey; + +X_API EXTERNAL Functor FunctorRDiv; + +X_API EXTERNAL Functor FunctorRedoFreeze; + +X_API EXTERNAL Functor FunctorRepresentationError; + +X_API EXTERNAL Functor FunctorResourceError; + +X_API EXTERNAL Functor FunctorRestoreRegs; + +X_API EXTERNAL Functor FunctorRestoreRegs1; + +X_API EXTERNAL Functor FunctorSafe; + +X_API EXTERNAL Functor FunctorSafeCallCleanup; + +X_API EXTERNAL Functor FunctorSame; + +X_API EXTERNAL Functor FunctorSlash; + +X_API EXTERNAL Functor FunctorStaticClause; + +X_API EXTERNAL Functor FunctorStream; + +X_API EXTERNAL Functor FunctorStreamEOS; + +X_API EXTERNAL Functor FunctorStreamPos; + +X_API EXTERNAL Functor FunctorString1; + +X_API EXTERNAL Functor FunctorStyleCheck; + +X_API EXTERNAL Functor FunctorSyntaxError; + +X_API EXTERNAL Functor FunctorShortSyntaxError; + +X_API EXTERNAL Functor FunctorTermExpansion; + +X_API EXTERNAL Functor FunctorThreadRun; + +X_API EXTERNAL Functor FunctorThrow; + +X_API EXTERNAL Functor FunctorTimeoutError; + +X_API EXTERNAL Functor FunctorTraceMetaCall; + +X_API EXTERNAL Functor FunctorTypeError; + +X_API EXTERNAL Functor FunctorUMinus; + +X_API EXTERNAL Functor FunctorUPlus; + +X_API EXTERNAL Functor FunctorVBar; + +X_API EXTERNAL Functor FunctorWriteTerm; + +X_API EXTERNAL Functor FunctorHiddenVar; diff --git a/H/tracer.h b/H/tracer.h index 055a64437..f63dc7b13 100644 --- a/H/tracer.h +++ b/H/tracer.h @@ -38,8 +38,8 @@ typedef enum { #define low_level_trace(Port, pred, args) low_level_trace__(Port, pred, args) #endif -void low_level_trace__(yap_low_level_port, PredEntry *, CELL *); -void Yap_InitLowLevelTrace(void); -void toggle_low_level_trace(void); +extern bool low_level_trace__(yap_low_level_port, PredEntry *, CELL *); +extern void Yap_InitLowLevelTrace(void); +extern void toggle_low_level_trace(void); #endif diff --git a/JIT/HPP/jit_predicates.hpp b/JIT/HPP/jit_predicates.hpp index 1d6785faa..2289b9a05 100644 --- a/JIT/HPP/jit_predicates.hpp +++ b/JIT/HPP/jit_predicates.hpp @@ -1,7 +1,7 @@ #include "Yap.h" #include "amijit.h" #include "clause.h" -#include "eval.h" +#include "YapEval.h" #if HAVE_ERRNO_H #include #else diff --git a/OPTYap/CMakeLists.txt b/OPTYap/CMakeLists.txt index 5ff5aee35..c3cd06398 100644 --- a/OPTYap/CMakeLists.txt +++ b/OPTYap/CMakeLists.txt @@ -76,16 +76,17 @@ endif (WITH_YAPOR_SBA) if (WITH_YAPOR) - set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR=1) + set_property(DIRECTORY .. APPEND PROPERTY COMPILE_DEFINITIONS YAPOR=1;YAP_KERNEL=1) endif () set (POSITION_INDEPENDENT_CODE TRUE) +SET_PROPERTY(DIRECTORY PROPERTY COMPILE_DEFINITIONS YAP_KERNEL=1 ) add_component (libOPTYap ${OPTYap_SOURCES} ) -MY_set_target_properties(libOPTYap +My_set_target_properties(libOPTYap PROPERTIES # RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION} # SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION} diff --git a/OPTYap/opt.preds.c b/OPTYap/opt.preds.c index 77d4182e8..fa7a69445 100644 --- a/OPTYap/opt.preds.c +++ b/OPTYap/opt.preds.c @@ -170,7 +170,7 @@ struct page_statistics { #define INCREMENT_AUX_STATS(STATS, BYTES, PAGES) \ BYTES += PgEnt_bytes_in_use(STATS) #define SHOW_PAGE_STATS_MSG(STR_NAME) \ - " %s %10" Int_F "s bytes (%ld structs in use)\n", STR_NAME + " %s %10" Int_F "s bytes (%" Sizet_F " ; structs in use)\n", STR_NAME #define SHOW_PAGE_STATS_ARGS(STATS, STR_TYPE) \ PgEnt_strs_in_use(STATS) * sizeof(STR_TYPE), PgEnt_strs_in_use(STATS) #endif /* USE_PAGES_MALLOC */ diff --git a/OPTYap/tab.tries.c b/OPTYap/tab.tries.c index cf05c885c..9f21e184d 100644 --- a/OPTYap/tab.tries.c +++ b/OPTYap/tab.tries.c @@ -19,7 +19,7 @@ #ifdef TABLING #include "Yatom.h" #include "YapHeap.h" -#include "eval.h" +#include "YapEval.h" #include "tab.macros.h" static inline sg_node_ptr diff --git a/Packages.cmake b/Packages.cmake index 9cb5b6a14..76096a280 100644 --- a/Packages.cmake +++ b/Packages.cmake @@ -38,7 +38,12 @@ ENDIF(WITH_CPLINT) #must be last +add_subDIRECTORY (packages/python) + +OPTION (WITH_SWIG " Enable SWIG interfaces to foreign languages" ON) +IF (WITH_SWIG) add_subDIRECTORY (packages/swig) +ENDIF (WITH_SWIG) # please install doxygen for prolog first @@ -50,15 +55,20 @@ add_subDIRECTORY (packages/swig) option (WITH_DOCS "generate YAP docs" OFF) - # add_subDIRECTORY (docs) + IF (WITH_DOCS) + add_subDIRECTORY (docs) + ENDIF (WITH_DOCS) # add_subDIRECTORY (packages/cuda) +option (WITH_GECODE +"interface gecode constraint solver" ON) +if (WITH_GECODE) add_subDIRECTORY (packages/gecode) +endif() add_subDIRECTORY (packages/real) -add_subDIRECTORY (packages/python) add_subDIRECTORY (packages/jpl) diff --git a/PrologCommons/PROLOGCOMMONS.md b/PrologCommons/PROLOGCOMMONS.md index a2d50cd9d..ecb96a348 100644 --- a/PrologCommons/PROLOGCOMMONS.md +++ b/PrologCommons/PROLOGCOMMONS.md @@ -1,4 +1,5 @@ - +Prolog Commons {#prolog_commons} +============= This directory should hold files from the Prolog Commons project. Please see diff --git a/README.md b/README.md index 610b8d187..756627999 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,12 @@ ![The YAP Logo](docs/icons/yap_128x128x32.png) -README for YAP6 +User Manual for YAP6 (#main) ==================== -NOTE: this version of YAP is stil experimental, documentation may be out of date. +NOTE: this version of YAP is still experimental, documentation may be out of date. -## Introduction +## Introduction This document provides User information on version 6.3.4 of YAP (Yet Another Prolog). The YAP Prolog System is a @@ -94,22 +94,3 @@ DTAI group of KULeuven. + The [R](http://stoics.org.uk/~nicos/sware/packs/real/) interface package developed by Nicos Angelopoulos, Vítor Santos Costa, João Azevedo, Jan Wielemaker, and Rui Camacho. - - -Downloading YAP {#download} -============== - -The latest development version of Yap-6 is yap-6.3.4 and can be -obtained from the repositories - - - -and - - - -YAP-6.3.4 does not use modules. Please just use `git clone` to obtain the distribution. - -Most of these repositories are basically copies of the original -repositories at the SWI-Prolog site. YAP-6 will work either with or -without these packages. diff --git a/autoconf/Makefile.in b/autoconf/Makefile.in index 02630b031..54e6e5395 100755 --- a/autoconf/Makefile.in +++ b/autoconf/Makefile.in @@ -167,13 +167,13 @@ HEADERS = \ H/attvar.h \ H/blobs.h \ H/clause.h \ - H/compile.h \ + H/YapCöompile.h \ H/corout.h \ H/dlmalloc.h \ H/dglobals.h \ H/dlocals.h \ H/dhstruct.h \ - H/eval.h \ + H/YapEval.h \ H/heapgc.h \ H/hglobals.h \ H/hlocals.h \ diff --git a/cmake/Config.cmake b/cmake/Config.cmake index a3f476fc9..2f9e1fdf6 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -145,30 +145,30 @@ endif (HAVE_LIBDL) if (WIN32) check_library_exists(comdlg32 FindText "" HAVE_LIBCOMDLG32) - if (HAVE_LIBCOMDLG32) + #if (HAVE_LIBCOMDLG32) - set(EXTRALIBS ${EXTRALIBS} comdlg32) - endif (HAVE_LIBCOMDLG32) + set(WINDLLS ${WINDLLS} comdlg32) + #endif (HAVE_LIBCOMDLG32) check_library_exists(msvcrt strtok "" HAVE_LIBMSCRT) - if (HAVE_LIBMSCRT) - set(EXTRALIBS ${EXTRALIBS} mscrt) - endif (HAVE_LIBMSCRT) +#if (HAVE_LIBMSCRT) + set(WINDLLS ${WINDLLS} mscrt) + #endif (HAVE_LIBMSCRT) check_library_exists(shell32 main "" HAVE_LIBSHELL32) - if (HAVE_LIBSHELL32) - set(EXTRALIBS ${EXTRALIBS} shell32) - endif (HAVE_LIBSHELL32) + #if (HAVE_LIBSHELL32) + set(WINDLLS ${WINDLLS} shell32) + #endif (HAVE_LIBSHELL32) check_library_exists(wsock32 main "" HAVE_LIBWSOCK32) - if (HAVE_LIBWSOCK32) - set(EXTRALIBS ${EXTRALIBS} wsock32) - endif (HAVE_LIBWSOCK32) + #if (HAVE_LIBWSOCK32) + set(WINDLLS ${WINDLLS} wsock32) + #endif (HAVE_LIBWSOCK32) check_library_exists(ws2_32 main "" HAVE_LIBWS2_32) - if (HAVE_LIBWS2_32) - set(EXTRALIBS ${EXTRALIBS} ws2_32) - endif (HAVE_LIBWS2_32) + #if (HAVE_LIBWS2_32 OR TRUE) + set(WINDLLS ${WINDLLS} ws2_32) + #endif (HAVE_LIBWS2_32) endif () check_library_exists(judy Judy1Set "" HAVE_LIBJUDY) @@ -265,8 +265,10 @@ check_symbol_exists(flsll HAVE_FLSLL) check_function_exists(fmemopen HAVE_FMEMOPEN) check_function_exists(fpclass HAVE_FPCLASS) check_function_exists(ftime HAVE_FTIME) -check_function_exists(ftru -wd HAVE_GETCWD) +check_function_exists(ftruncate HAVE_FTRUNCATE) +check_function_exists(funopen HAVE_FUNOPEN) +#check_function_exists(gcc HAVE_GCC) +check_function_exists(getcwd HAVE_GETCWD) check_function_exists(getenv HAVE_GETENV) check_function_exists(getexecname HAVE_GETEXECNAME) check_function_exists(gethostbyname HAVE_GETHOSTBYNAME) @@ -323,8 +325,7 @@ check_function_exists(setlocale HAVE_SETLOCALE) check_function_exists(setsid HAVE_SETSID) check_function_exists(shmat HAVE_SHMAT) check_function_exists(sigaction HAVE_SIGACTION) -check_symbol_exists(SI -GFPE signal.h HAVE_SIGFPE) +check_symbol_exists(SIGFPE signal.h HAVE_SIGFPE) check_function_exists(siggetmask HAVE_SIGGETMASK) check_symbol_exists(SIGINFO signal.h HAVE_SIGINFO) check_function_exists(siginterrupt HAVE_SIGINTERRUPT) @@ -340,10 +341,14 @@ check_function_exists(socklen_t HAVE_SOCKLEN_T) check_function_exists(sqllen HAVE_SQLLEN) check_function_exists(sqlulen HAVE_SQLULEN) check_function_exists(srand HAVE_SRAND) -check_function_exists(srand HAVE_SRAND48) +check_function_exists(srand48 HAVE_SRAND48) check_function_exists(srandom HAVE_SRANDOM) +check_function_exists(stpcpy HAVE_STPCPY) +check_function_exists(stpncpy HAVE_STPNCPY) check_function_exists(ssize_t HAVE_SSIZE_T) check_function_exists(stat HAVE_STAT) +check_function_exists(strcat HAVE_STRCAT) +check_function_exists(strncat HAVE_STRNCAT) check_function_exists(strcasecmp HAVE_STRCASECMP) check_function_exists(strcasestr HAVE_STRCASESTR) check_function_exists(strchr HAVE_STRCHR) @@ -401,11 +406,3 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake configure_file(${CMAKE_CURRENT_LIST_DIR}/../GitSHA1.c.in GitSHA1.c @ONLY) configure_file(${CMAKE_CURRENT_LIST_DIR}/../os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/os/YapIOConfig.h) -check_include_files( "stdio.h;cudd.h" HAVE_CTYPE_HUDD_H ) - -check_include_files( "stdio.h;cuddI.h" HAVE_CUDD_H ) -check_include_files( "cudd.h;cuddInt.h" HAVE_CUDDINT_H ) -check_include_files( "stdio.h;cudd/cudd.h" HAVE_CUDD_CUDD_H ) -check_include_files( "stdio.h;cudd/cuddInt.h" HAVE_CUDD_CUDDINT_H ) -configure_file (cmake/cudd_config.h.cmake - "${CMAKE_CURRENT_BINARY_DIR}/cudd_config.h" ) diff --git a/cmake/FindCUDD.cmake b/cmake/FindCUDD.cmake index c8821176a..fea698ff2 100644 --- a/cmake/FindCUDD.cmake +++ b/cmake/FindCUDD.cmake @@ -1,150 +1,47 @@ -# - Try to find the CUDD BDD package -# Once done this will define +# Try to find CUDD headers and libraries. # -# CUDD_FOUND - system has CUDD -# CUDD_LIBRARIES - Link these to use CUDD -# CUDD_INCLUDE_DIR - Include directory for using CUDD +# Usage of this module as follows: # -# Based on FindFontconfig Copyright (c) 2006,2007 Laurent Montel, +# find_package(CUDD) # -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# Variables used by this module, they can change the default behaviour and need +# to be set before calling find_package: +# +# CUDD_ROOT Set this variable to the root installation of +# libcudd if the module has problems finding the +# proper installation path. +# +# Variables defined by this module: +# +# CUDD_FOUND System has CUDD libraries and headers +# CUDD_LIBRARIES The CUDD library +# CUDD_INCLUDE_DIR The location of CUDD headers -SET( CUDD_FOUND "NO" ) - -set (CUDD_INCLUDE_SEARCH_PATH - ${CMAKE_INSTALL_PREFIX}/include - /usr/local/yap/include - /usr/local/Yap/include - /usr/local/cudd/include - /usr/lib/cudd/include - ~/Library/Frameworks - /Library/Frameworks - /usr/local/include - /usr/include/ - /sw/include # Fink - /opt/local/include # MacPorts - /opt/csw/include # Blastwave - /opt/include - /usr/freeware/include - ) - - - -set (CUDD_LIB_SEARCH_PATH - ${CMAKE_INSTALL_PREFIX}/lib - /usr/lib - /usr/local/lib/cudd - /usr/local/cudd/lib - /usr/lib/cudd - /usr/lib/cudd/lib - /usr/freeware/lib ) - -if ($ENV{CUDD_ROOT}) - list (APPEND CUDD_LIB_SEARCH_PATH - $ENV{CUDD_ROOT}/lib - $ENV{CUDD_ROOT}/lib-dbg - $ENV{CUDD_ROOT} ) - - list (APPEND CUDD_INCLUDE_SEARCH_PATH - $ENV{CUDD_ROOT}/include ) +# Get hint from environment variable (if any) +if(NOT CUDD_ROOT AND DEFINED ENV{CUDD_ROOT}) + set(CUDD_ROOT "$ENV{CUDD_ROOT}" CACHE PATH "CUDD base directory location (optional, used for nonstandard installation paths)") + mark_as_advanced(CUDD_ROOT) endif() -if (${CUDD_ROOT}) - list (APPEND CUDD_LIB_SEARCH_PATH - ${CUDD_ROOT}/lib - ${CUDD_ROOT}/lib-dbg - ${CUDD_ROOT} ) - list (APPEND CUDD_INCLUDE_SEARCH_PATH - ${CUDD_ROOT}/include ) +# Search path for nonstandard locations +if(CUDD_ROOT) + set(CUDD_INCLUDE_PATH PATHS "${CUDD_ROOT}/include" NO_DEFAULT_PATH) + set(CUDD_LIBRARY_PATH PATHS "${CUDD_ROOT}/lib" NO_DEFAULT_PATH) endif() -# Check if we have cached results in case the last round was successful. - - find_package(PkgConfig) - - find_path(CUDD_INCLUDE_DIR - NAMES cudd.h cudd/cudd.h - ${CUDD_INCLUDE_SEARCH_PATH} - ) - - mark_as_advanced(CUDD_INCLUDE_DIR) - -if (CUDD_INCLUDE_DIR) - - find_library(CUDD_LIBRARIES - NAMES cudd - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) - - if (CUDD_LIBRARIES) - - SET( CUDD_FOUND "YES" ) - -find_library(CUDD_DDDMP_LIBRARY - NAMES dddmp - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) - -if (CUDD_DDMP_LIBRARY) - list( APPEND CUDD_LIBRARIES ${CUDD_DDMP_LIBRARY} ) +# Search path for nonstandard locations +if(CUDD_ROOT_DIR) + set(CUDD_INCLUDE_PATH PATHS "${CUDD_ROOT_DIR}/include" NO_DEFAULT_PATH) + set(CUDD_LIBRARY_PATH PATHS "${CUDD_ROOT_DIR}/lib" NO_DEFAULT_PATH) endif() -find_library(CUDD_EPD_LIBRARY - NAMES epd - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) - -if (CUDD_EPD_LIBRARY) - list( APPEND CUDD_LIBRARIES ${CUDD_EPD_LIBRARY} ) -endif() - - find_library(CUDD_ST_LIBRARY - NAMES cuddst - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) - -if (CUDD_ST_LIBRARY) - list( APPEND CUDD_LIBRARIES ${CUDD_ST_LIBRARY} ) -endif() +find_path(CUDD_INCLUDE_DIR NAMES cudd.h cudd/cudd.h HINTS ${CUDD_INCLUDE_PATH}) +find_library(CUDD_LIBRARIES NAMES cudd CUDDVC-2.5.0 HINTS ${CUDD_LIBRARY_PATH}) - - find_library(CUDD_UTIL_LIBRARY - NAMES cuddutil - - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) - -if (CUDD_UTIL_LIBRARY) - list( APPEND CUDD_LIBRARIES ${CUDD_ST_LIBRARY} ) -endif() +include(FindPackageHandleStandardArgs) - find_library(CUDD_MTR_LIBRARY - NAMES mtr - PATHS - ${CUDD_LIB_SEARCH_PATH} - ) +find_package_handle_standard_args(CUDD DEFAULT_MSG CUDD_LIBRARIES CUDD_INCLUDE_DIR) -if (CUDD_MTR_LIBRARY) - list( APPEND CUDD_LIBRARIES ${CUDD_MTR_LIBRARY} ) -endif() - -endif() - -endif() - - mark_as_advanced(CUDD_LIBRARIES) - - - -mark_as_advanced (CUDD_FOUND) - - -find_package_handle_standard_args(CUDD DEFAULT_MSG CUDD_LIBRARIES CUDD_INCLUDE_DIR ) +mark_as_advanced(CUDD_ROOT CUDD_LIBRARIES CUDD_INCLUDE_DIR) diff --git a/cmake/FindGecode.cmake b/cmake/FindGecode.cmake index 5055b0de5..402767dee 100644 --- a/cmake/FindGecode.cmake +++ b/cmake/FindGecode.cmake @@ -1,12 +1,12 @@ #source from http://code.google.com/p/cpfloat-gecode/source/browse/trunk/cmake-support/FindGecode.cmake?r=9 - +# #Works under the assumption than when gecode is installed at least the kernel component exists # Look for the header file -find_path(GECODE_INCLUDE_DIR NAMES gecode/kernel.hh PATHS ${CMAKE_INSTALL_PREFIX}/include) -find_file(GECODE_CONFIG gecode/support/config.hpp PATHS ${CMAKE_INSTALL_PREFIX}/include) +find_path(GECODE_INCLUDE_DIR NAMES gecode/kernel.hh PATHS ${GECODE_ROOT_DIR}/include ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /opt/local/include /usr}/include) +find_file(GECODE_CONFIG gecode/support/config.hpp PATHS ${GECODE_ROOT_DIR}/include ${CMAKE_INSTALL_PREFIX}/include /usr/local/include /opt/local/include /usr}/include) # Look for the library -find_library(GECODE_LIBRARY NAMES gecodekernel PATHS ${CMAKE_INSTALL_PREFIX}/lib) -find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupportl PATHS ${CMAKE_INSTALL_PREFIX}/lib) +find_library(GECODE_LIBRARY NAMES gecodekernel PATHS ${GECODE_ROOT_DIR}/lib ${CMAKE_INSTALL_PREFIX}/lib /usr/local/lib /opt/local/lib /usr}/lib) +find_library(GECODE_SUPPORT_LIBRARY NAMES gecodesupport PATHS ${GECODE_ROOT_DIR}/lib ${CMAKE_INSTALL_PREFIX}/lib /usr/local/lib /opt/local/lib /usr}/include) if(GECODE_CONFIG) file(STRINGS ${GECODE_CONFIG} GECODE_LINE_VERSION REGEX "^#define GECODE_VERSION .*") @@ -20,39 +20,39 @@ endif() if(GECODE_FOUND) set(GECODE_LIBRARIES ${GECODE_LIBRARY} ${GECODE_SUPPORT_LIBRARY}) set(GECODE_INCLUDE_DIRS ${GECODE_INCLUDE_DIR}) - find_library(GECODE_DRIVER_LIBRARY gecodedriverl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_DRIVER_LIBRARY gecodedriver PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_FZ_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_FZ_LIBRARY}) endif() - find_library(GECODE_GIST_LIBRARY gecodegistl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_GIST_LIBRARY gecodegist PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_GIST_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_GIST_LIBRARY}) endif() - find_library(GECODE_GRAPH_LIBRARY gecodegraphl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_GRAPH_LIBRARY gecodegraph PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_GRAPH_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_GRAPH_LIBRARY}) endif() - find_library(GECODE_INT_LIBRARY gecodeintl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_INT_LIBRARY gecodeint PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_INT_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_INT_LIBRARY}) endif() - find_library(GECODE_FLOAT_LIBRARY gecodefloatl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_FLOAT_LIBRARY gecodefloat PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_FLOAT_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_FLOAT_LIBRARY}) endif() - find_library(GECODE_MM_LIBRARY gecodeminimodell PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_MM_LIBRARY gecodeminimodel PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_MM_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_MM_LIBRARY}) endif() - find_library(GECODE_SCHEDULING_LIBRARY gecodeschedulingl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_SCHEDULING_LIBRARY gecodescheduling PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_SCHEDULING_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_SCHEDULING_LIBRARY}) endif() - find_library(GECODE_SEARCH_LIBRARY gecodesearchl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_SEARCH_LIBRARY gecodesearch PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_SEARCH_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_SEARCH_LIBRARY}) endif() - find_library(GECODE_SET_LIBRARY gecodesetl PATHS ${CMAKE_INSTALL_PREFIX}/lib) + find_library(GECODE_SET_LIBRARY gecodeset PATHS ${CMAKE_INSTALL_PREFIX}/lib) if(GECODE_SET_LIBRARY) list(APPEND GECODE_LIBRARIES ${GECODE_SET_LIBRARY}) endif() diff --git a/cmake/FindLibR.cmake b/cmake/FindLibR.cmake old mode 100644 new mode 100755 diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake index 0249c7f5a..eed370cfe 100644 --- a/cmake/FindMySQL.cmake +++ b/cmake/FindMySQL.cmake @@ -11,6 +11,7 @@ IF (MYSQL_INCLUDE_DIR) ENDIF (MYSQL_INCLUDE_DIR) FIND_PATH(MYSQL_INCLUDE_DIR mysql.h + ${MYSQL_ROOT_DIR}/include /usr/local/include/mysql /usr/include/mysql /usr/include/mariadb @@ -18,7 +19,8 @@ FIND_PATH(MYSQL_INCLUDE_DIR mysql.h SET(MYSQL_NAMES mysqlclient mysqlclient_r mariadb ) FIND_LIBRARY(MYSQL_LIBRARY - NAMES ${MYSQL_NAMES} + NAMES ${MYSQL_ROOT_DIR}/lib + ${MYSQL_NAMES} PATHS /usr/lib /usr/local/lib PATH_SUFFIXES mysql mariadb ) @@ -45,4 +47,4 @@ ENDIF (MYSQL_FOUND) MARK_AS_ADVANCED( MYSQL_LIBRARY MYSQL_INCLUDE_DIR - ) \ No newline at end of file + ) diff --git a/cmake/FindODBC.cmake b/cmake/FindODBC.cmake index 9348a7163..667e44cd7 100644 --- a/cmake/FindODBC.cmake +++ b/cmake/FindODBC.cmake @@ -19,6 +19,7 @@ set(ODBC_FOUND FALSE) find_path(ODBC_INCLUDE_DIRECTORIES sql.h + ${ODBC_ROOT_DIR}/include /usr/include /usr/include/odbc /usr/local/include @@ -34,6 +35,7 @@ find_path(ODBC_INCLUDE_DIRECTORIES sql.h find_library(ODBC_LIBRARY NAMES iodbc odbc odbcinst odbc32 PATHS + ${ODBC_ROOT_DIR}/lib /usr/lib /usr/lib/odbc /usr/local/lib diff --git a/cmake/FindR.cmake b/cmake/FindR.cmake deleted file mode 100644 index 6ae435459..000000000 --- a/cmake/FindR.cmake +++ /dev/null @@ -1,48 +0,0 @@ - -# -# - This module locates an installed R distribution. -# -# Defines the following: -# -# R_INCLUDE_DIR - Path to R include directory -# R_LIBRARIES - Path to R library -# R_LIBRARY_BASE - -# R_COMMAND - Path to R command -# RSCRIPT_EXECUTABLE - Path to Rscript command -# - - -# Make sure find package macros are included -include( FindPackageHandleStandardArgs ) - -set(TEMP_CMAKE_FIND_APPBUNDLE ${CMAKE_FIND_APPBUNDLE}) -set(CMAKE_FIND_APPBUNDLE "NEVER") -find_program(R_COMMAND R DOC "R executable.") -if(R_COMMAND) - execute_process(WORKING_DIRECTORY . COMMAND ${R_COMMAND} RHOME OUTPUT_VARIABLE R_BASE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) - set(R_HOME ${R_BASE_DIR} CACHE PATH "R home directory obtained from R RHOME") - mark_as_advanced(R_HOME) -endif(R_COMMAND) - -find_program(RSCRIPT_EXECUTABLE Rscript DOC "Rscript executable.") - -set(CMAKE_FIND_APPBUNDLE ${TEMP_CMAKE_FIND_APPBUNDLE}) - -# R.h gets installed in all sorts of places - -# ubuntu: /usr/share/R/include, RHEL/Fedora: /usr/include/R/R.h -find_path(R_INCLUDE_DIR R.h PATHS ${R_INCLUDE_DIR_HINT} /usr/local/lib /usr/local/lib64 /usr/share /usr/include ${R_BASE_DIR} PATH_SUFFIXES include R R/include DOC "Path to file R.h") -find_library(R_LIBRARY_BASE R PATHS ${R_BASE_DIR} PATH_SUFFIXES /lib DOC "R library (example libR.a, libR.dylib, etc.).") - -set(R_LIBRARIES ${R_LIBRARY_BASE}) -mark_as_advanced(RSCRIPT_EXECUTABLE R_LIBRARIES R_INCLUDE_DIR R_COMMAND R_LIBRARY_BASE) - - -set( _REQUIRED_R_VARIABLES R_INCLUDE_DIR R_COMMAND ) - -if( APPLE ) - # On linux platform some times the libR.so is not available, however - # on apple a link error results if the library is linked. - list( APPEND _REQUIRED_R_VARIABLES R_LIBRARIES R_LIBRARY_BASE ) -endif() - -find_package_handle_standard_args(R DEFAULT_MSG ${_REQUIRED_R_VARIABLES} ) diff --git a/cmake/Model.cmake b/cmake/Model.cmake index 9533386e5..bb238bdfe 100644 --- a/cmake/Model.cmake +++ b/cmake/Model.cmake @@ -2,7 +2,7 @@ set(YAP_FOUND ON) set(YAP_MAJOR_VERSION 6) set(YAP_MINOR_VERSION 3) -set(YAP_PATCH_VERSION 4) +set(YAP_PATCH_VERSION 5) set(YAP_FULL_VERSION ${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}.${YAP_PATCH_VERSION}) @@ -17,6 +17,7 @@ site_name( YAP_SITE ) if (WIN32) set (YAP_ARCH $ENV{PROCESSOR_ARCHITECTURE}) + set_property( DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "MS_WIN64=1" ) set(YAP_SYSTEM_OPTIONS "windows " ${YAP_SYSTEM_OPTIONS}) endif() if (UNIX) diff --git a/cmake/NewUseSWIG.cmake b/cmake/NewUseSWIG.cmake new file mode 100644 index 000000000..93447b092 --- /dev/null +++ b/cmake/NewUseSWIG.cmake @@ -0,0 +1,335 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#.rst: +# UseSWIG +# ------- +# +# Defines the following macros for use with SWIG: +# +# :: +# +# SWIG_ADD_LIBRARY( +# language> +# [TYPE ] +# [[SOURCES] ...]) +# - Define swig module with given name and specified language +# SWIG_LINK_LIBRARIES(name [ libraries ]) +# - Link libraries to swig module +# +# Source files properties on module files can be set before the invocation +# of the SWIG_ADD_LIBRARY macro to specify special behavior of SWIG. +# +# The source file property CPLUSPLUS calls SWIG in c++ mode, e.g.:: +# +# set_property(SOURCE mymod.i PROPERTY CPLUSPLUS ON) +# swig_add_library(mymod LANGUAGE python SOURCES mymod.i) +# +# The source file property SWIG_FLAGS adds custom flags to the SWIG executable. +# +# The source-file property SWIG_MODULE_NAME have to be provided to specify the actual +# import name of the module in the target language if it cannot be scanned automatically +# from source or different from the module file basename.:: +# +# set_property(SOURCE mymod.i PROPERTY SWIG_MODULE_NAME mymod_realname) +# +# To get the name of the swig module target library, use: ${SWIG_MODULE_${name}_REAL_NAME}. +# +# Also some variables can be set to specify special behavior of SWIG. +# +# CMAKE_SWIG_FLAGS can be used to add special flags to all swig calls. +# +# CMAKE_SWIG_OUTDIR allows one to specify where to write +# the language specific files (swig -outdir option). +# +# SWIG_OUTFILE_DIR allows one to specify where to write the output file +# (swig -o option). If not specified, CMAKE_SWIG_OUTDIR is used. +# +# The name-specific variable SWIG_MODULE__EXTRA_DEPS may be used to specify extra +# dependencies for the generated modules. +# +# If the source file generated by swig need some special flag you can use:: +# +# set_source_files_properties( ${swig_generated_file_fullname} +# PROPERTIES COMPILE_FLAGS "-bla") + +set(SWIG_CXX_EXTENSION "cxx") +set(SWIG_EXTRA_LIBRARIES "") + +set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py") + +# +# For given swig module initialize variables associated with it +# +macro(SWIG_MODULE_INITIALIZE name language) + string(TOUPPER "${language}" swig_uppercase_language) + string(TOLOWER "${language}" swig_lowercase_language) + set(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}") + set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}") + + set(SWIG_MODULE_${name}_REAL_NAME "${name}") + if (";${CMAKE_SWIG_FLAGS};" MATCHES ";-noproxy;") + set (SWIG_MODULE_${name}_NOPROXY TRUE) + endif () + if("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xUNKNOWN") + message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found") + elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPYTHON" AND NOT SWIG_MODULE_${name}_NOPROXY) + # swig will produce a module.py containing an 'import _modulename' statement, + # which implies having a corresponding _modulename.so (*NIX), _modulename.pyd (Win32), + # unless the -noproxy flag is used + set(SWIG_MODULE_${name}_REAL_NAME "_${name}") + elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xPERL") + set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow") + elseif("x${SWIG_MODULE_${name}_LANGUAGE}" STREQUAL "xCSHARP") + # This makes sure that the name used in the generated DllImport + # matches the library name created by CMake + set(SWIG_MODULE_${name}_EXTRA_FLAGS "-dllimport;${name}") + endif() +endmacro() + +# +# For a given language, input file, and output file, determine extra files that +# will be generated. This is internal swig macro. +# + +macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile) + set(${outfiles} "") + get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename + ${infile} SWIG_MODULE_NAME) + if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND") + + # try to get module name from "%module foo" syntax + if ( EXISTS ${infile} ) + file ( STRINGS ${infile} _MODULE_NAME REGEX "[ ]*%module[ ]*[a-zA-Z0-9_]+.*" ) + endif () + if ( _MODULE_NAME ) + string ( REGEX REPLACE "[ ]*%module[ ]*([a-zA-Z0-9_]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" ) + set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}") + + else () + # try to get module name from "%module (options=...) foo" syntax + if ( EXISTS ${infile} ) + file ( STRINGS ${infile} _MODULE_NAME REGEX "[ ]*%module[ ]*\\(.*\\)[ ]*[a-zA-Z0-9_]+.*" ) + endif () + if ( _MODULE_NAME ) + string ( REGEX REPLACE "[ ]*%module[ ]*\\(.*\\)[ ]*([a-zA-Z0-9_]+).*" "\\1" _MODULE_NAME "${_MODULE_NAME}" ) + set(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${_MODULE_NAME}") + + else () + # fallback to file basename + get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename ${infile} NAME_WE) + endif () + endif () + + endif() + foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION}) + set(${outfiles} ${${outfiles}} + "${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}") + endforeach() +endmacro() + +# +# Take swig (*.i) file and add proper custom commands for it +# +macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile) + set(swig_full_infile ${infile}) + get_filename_component(swig_source_file_name_we "${infile}" NAME_WE) + get_source_file_property(swig_source_file_generated ${infile} GENERATED) + get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS) + get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS) + if("${swig_source_file_flags}" STREQUAL "NOTFOUND") + set(swig_source_file_flags "") + endif() + get_filename_component(swig_source_file_fullname "${infile}" ABSOLUTE) + + # If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir + if(CMAKE_SWIG_OUTDIR) + set(swig_outdir ${CMAKE_SWIG_OUTDIR}) + else() + set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR}) + endif() + + if(SWIG_OUTFILE_DIR) + set(swig_outfile_dir ${SWIG_OUTFILE_DIR}) + else() + set(swig_outfile_dir ${swig_outdir}) + endif() + + if (NOT SWIG_MODULE_${name}_NOPROXY) + SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE} + swig_extra_generated_files + "${swig_outdir}" + "${swig_source_file_fullname}") + endif() + set(swig_generated_file_fullname + "${swig_outfile_dir}/${swig_source_file_name_we}") + # add the language into the name of the file (i.e. TCL_wrap) + # this allows for the same .i file to be wrapped into different languages + string(APPEND swig_generated_file_fullname + "${SWIG_MODULE_${name}_LANGUAGE}_wrap") + + if(swig_source_file_cplusplus) + string(APPEND swig_generated_file_fullname + ".${SWIG_CXX_EXTENSION}") + else() + string(APPEND swig_generated_file_fullname + ".c") + endif() + + #message("Full path to source file: ${swig_source_file_fullname}") + #message("Full path to the output file: ${swig_generated_file_fullname}") + get_directory_property(cmake_include_directories INCLUDE_DIRECTORIES) + list(REMOVE_DUPLICATES cmake_include_directories) + set(swig_include_dirs) + foreach(it ${cmake_include_directories}) + set(swig_include_dirs ${swig_include_dirs} "-I${it}") + endforeach() + + set(swig_special_flags) + # default is c, so add c++ flag if it is c++ + if(swig_source_file_cplusplus) + set(swig_special_flags ${swig_special_flags} "-c++") + endif() + set(swig_extra_flags) + if(SWIG_MODULE_${name}_EXTRA_FLAGS) + set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS}) + endif() + add_custom_command( + OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files} + # Let's create the ${swig_outdir} at execution time, in case dir contains $(OutDir) + COMMAND ${CMAKE_COMMAND} -E make_directory ${swig_outdir} + COMMAND "${SWIG_EXECUTABLE}" + ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}" + ${swig_source_file_flags} + ${CMAKE_SWIG_FLAGS} + -outdir ${swig_outdir} + ${swig_special_flags} + ${swig_extra_flags} + ${swig_include_dirs} + -o "${swig_generated_file_fullname}" + "${swig_source_file_fullname}" + MAIN_DEPENDENCY "${swig_source_file_fullname}" + DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS} + COMMENT "Swig source") + set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files} + PROPERTIES GENERATED 1) + set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files}) +endmacro() + +# +# Create Swig module +# +macro(SWIG_ADD_MODULE name language) + message(DEPRECATION "SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.") + swig_add_library(${name} + LANGUAGE ${language} + TYPE MODULE + SOURCES ${ARGN}) +endmacro() + + +macro(SWIG_ADD_LIBRARY name) + + include(CMakeParseArguments) + set(options "") + set(oneValueArgs LANGUAGE + TYPE) + set(multiValueArgs SOURCES) + cmake_parse_arguments(_SAM "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + if(NOT DEFINED _SAM_LANGUAGE) + message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing LANGUAGE argument") + endif() + + if(NOT DEFINED _SAM_SOURCES) + message(FATAL_ERROR "SWIG_ADD_LIBRARY: Missing SOURCES argument") + endif() + + if(NOT DEFINED _SAM_TYPE) + set(_SAM_TYPE MODULE) + endif() + + swig_module_initialize(${name} ${_SAM_LANGUAGE}) + + set(swig_dot_i_sources) + set(swig_other_sources) + foreach(it ${_SAM_SOURCES}) + if(${it} MATCHES "\\.i$") + set(swig_dot_i_sources ${swig_dot_i_sources} "${it}") + else() + set(swig_other_sources ${swig_other_sources} "${it}") + endif() + endforeach() + + set(swig_generated_sources) + foreach(it ${swig_dot_i_sources}) + SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it}) + set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}") + endforeach() + get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES) + set_directory_properties(PROPERTIES + ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}") + add_library(${SWIG_MODULE_${name}_REAL_NAME} + ${_SAM_TYPE} + ${swig_generated_sources} + ${swig_other_sources}) + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES NO_SONAME ON) + string(TOLOWER "${_SAM_LANGUAGE}" swig_lowercase_language) + if ("${swig_lowercase_language}" STREQUAL "octave") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".oct") + elseif ("${swig_lowercase_language}" STREQUAL "go") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + elseif ("${swig_lowercase_language}" STREQUAL "java") + if (APPLE) + # In java you want: + # System.loadLibrary("LIBRARY"); + # then JNI will look for a library whose name is platform dependent, namely + # MacOS : libLIBRARY.jnilib + # Windows: LIBRARY.dll + # Linux : libLIBRARY.so + set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib") + endif () + elseif ("${swig_lowercase_language}" STREQUAL "lua") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + elseif ("${swig_lowercase_language}" STREQUAL "python") + # this is only needed for the python case where a _modulename.so is generated + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + # Python extension modules on Windows must have the extension ".pyd" + # instead of ".dll" as of Python 2.5. Older python versions do support + # this suffix. + # http://docs.python.org/whatsnew/ports.html#SECTION0001510000000000000000 + # + # Windows: .dll is no longer supported as a filename extension for extension modules. + # .pyd is now the only filename extension that will be searched for. + # + if(WIN32 AND NOT CYGWIN) + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd") + endif() + elseif ("${swig_lowercase_language}" STREQUAL "r") + set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + elseif ("${swig_lowercase_language}" STREQUAL "ruby") + # In ruby you want: + # require 'LIBRARY' + # then ruby will look for a library whose name is platform dependent, namely + # MacOS : LIBRARY.bundle + # Windows: LIBRARY.dll + # Linux : LIBRARY.so + set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "") + if (APPLE) + set_target_properties (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle") + endif () + endif () +endmacro() + +# +# Like TARGET_LINK_LIBRARIES but for swig modules +# +macro(SWIG_LINK_LIBRARIES name) + if(SWIG_MODULE_${name}_REAL_NAME) + target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN}) + else() + message(SEND_ERROR "Cannot find Swig library \"${name}\".") + endif() +endmacro() + diff --git a/Prelims.cmake b/cmake/Prelims.cmake similarity index 90% rename from Prelims.cmake rename to cmake/Prelims.cmake index d07f05a50..a7c4e5290 100644 --- a/Prelims.cmake +++ b/cmake/Prelims.cmake @@ -128,23 +128,21 @@ endif(POLICY CMP0043) if (ANDROID) - set ( prefix ${YAP_APP_DIR}/app/src/generated ) - set ( datarootdir ${YAP_APP_DIR}/app/src/generated/assets ) -set ( includedir "${prefix}/assets/include") - set ( libpl ${YAP_APP_DIR}/app/src/generated/assets/Yap) + set ( prefix ${YAP_APP_DIR}/build ) + set ( datarootdir ${prefix}/assets ) else() set ( prefix "${CMAKE_INSTALL_PREFIX}") -set ( datarootdir "${prefix}/share") - set ( libpl "${datarootdir}/Yap") -set ( includedir "${prefix}/include") + set ( datarootdir ${prefix}/share ) endif() + set ( libpl ${datarootdir}/Yap) +set ( includedir "${prefix}/include") set ( exec_prefix "${prefix}") set ( libdir "${exec_prefix}/lib") -set ( dlls "${exec_prefix}/lib/Yap") set ( datadir "${datarootdir}") set ( mandir "${datarootdir}/man") set ( bindir "${exec_prefix}/bin") -set ( docdir "${exec_prefix}/doc/Yap") +set ( docdir "${datarootdir}/doc/Yap") +set ( dlls "${exec_prefix}/lib/Yap") set(YAP_ROOTDIR ${prefix}) @@ -166,4 +164,3 @@ set(YAP_ROOTDIR "${prefix}") include (cudd NO-POLICY-SCOPE) include (python NO-POLICY-SCOPE) include (java NO-POLICY-SCOPE) - diff --git a/cmake/Sources.cmake b/cmake/Sources.cmake index 778867c94..715808c86 100644 --- a/cmake/Sources.cmake +++ b/cmake/Sources.cmake @@ -124,13 +124,13 @@ list(APPEND LIBYAP_SOURCES ${C_INTERFACE_SOURCES} ${ENGINE_SOURCES}) H/attvar.h H/blobs.h H/clause.h - H/compile.h + H/YapCompile.h H/corout.h H/dlmalloc.h H/generated/dglobals.h H/generated/dlocals.h H/generated/dhstruct.h - H/eval.h + H/YapEval.h H/heapgc.h H/generated/hglobals.h H/generated/hlocals.h diff --git a/cmake/cudd.cmake b/cmake/cudd.cmake index 7345e360d..5e0768b26 100644 --- a/cmake/cudd.cmake +++ b/cmake/cudd.cmake @@ -17,6 +17,14 @@ macro_log_feature (CUDD_FOUND "CUDD" if (CUDD_FOUND) set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CUDD_INCLUDE_DIR} ) +check_include_files( "stdio.h;cudd.h" HAVE_CTYPE_HUDD_H ) + +check_include_files( "stdio.h;cuddI.h" HAVE_CUDD_H ) +check_include_files( "cudd.h;cuddInt.h" HAVE_CUDDINT_H ) +check_include_files( "stdio.h;cudd/cudd.h" HAVE_CUDD_CUDD_H ) +check_include_files( "stdio.h;cudd/cuddInt.h" HAVE_CUDD_CUDDINT_H ) +configure_file (cmake/cudd_config.h.cmake + "${CMAKE_CURRENT_BINARY_DIR}/cudd_config.h" ) endif (CUDD_FOUND) diff --git a/cmake/python.cmake b/cmake/python.cmake index 3898249b1..9f6776f68 100644 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -1,33 +1,73 @@ +option (WITH_PYTHON +"Allow Python->YAP and YAP->Python" ON) + -#BREW install for Python3 +# PYTHONLIBS_FOUND - have the Python libs been found +# PYTHON_LIBRARIES - path to the python library +# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) +# PYTHON_INCLUDE_DIRS - path to where Python.h is found +# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated) +# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8) +# +# +IF (WITH_PYTHON) + set (Python_ADDITIONAL_VERSIONS 3.5 3.6 3.4 3.3) + + find_package(PythonInterp) + # find_package(PythonLibs) -if (APPLE) -foreach (i 3.6 3.5 3.4 3.3 3.2 3.1 3.0) - set (PYTHON_INCLUDE_DIRS /usr/local/Frameworks/Python.framework/Versions/${i}/Headers) - message("Trying Python ${i}") - if (EXISTS ${PYTHON_INCLUDE_DIRS}) - set (PYTHON_EXECUTABLE /usr/local/bin/python${i} CACHE FILEPATH "Path to a program" FORCE ) - set (PYTHON_INCLUDE_DIR /usr/local/Frameworks/Python.framework/Versions/${i}/include/python${i}m - CACHE PATH "Path to a file." FORCE ) - set (PYTHON_LIBRARY /usr/local/Frameworks/Python.framework/Versions/${i}/lib/libpython${i}.dylib - CACHE FILEPATH "Path to a library" FORCE ) - break() - endif() -endforeach() -else() -set (Python_ADDITIONAL_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.8 2.6 2.5) + execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( sysconfig.get_path( 'include' ) )" +OUTPUT_VARIABLE _ABS_PYTHON_INCLUDE_PATH +OUTPUT_STRIP_TRAILING_WHITESPACE ) +get_filename_component ( ABS_PYTHON_INCLUDE_PATH ${_ABS_PYTHON_INCLUDE_PATH} ABSOLUTE ) + + set ( PYTHON_INCLUDE_DIR + ${ABS_PYTHON_INCLUDE_PATH} + CACHE "PATH" "Directory with Python.h " + ) + + set ( PYTHON_INCLUDE_DIRS + ${ABS_PYTHON_INCLUDE_PATH} + CACHE "PATH" "Python.h Dir (Deprecated)" + ) + + execute_process ( COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print( sysconfig.get_path( 'stdlib' ) )" + OUTPUT_VARIABLE _ABS_PYTHON_SYSLIB_PATH + OUTPUT_STRIP_TRAILING_WHITESPACE ) + + find_library(ABS_PYTHON_SYSLIB_PATH + NAMES python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}m + PATHS _ABS_PYTHON_SYSLIB_PATH + ) + + set ( PYTHON_LIBRARY + ${ABS_PYTHON_SYSLIB_PATH} + CACHE "FILEPATH" "Python Library" + ) + set ( PYTHON_LIBRARIES + ${PYTHON_LIBRARY} + CACHE "FILEPATH" "Python Library (Deprecated)" + ) + if ( (EXISTS ${PYTHON_LIBRARY}) AND ( EXISTS ${PYTHON_INCLUDE_DIR}) ) + set ( PYTHONLIBS_FOUND ON ) +# else() + +#find_package(PythonLibs) endif() -find_package(PythonInterp) -find_package(PythonLibs) + macro_log_feature (PYTHONLIBS_FOUND "Python" + "Use Python System" + "http://www.python.org" FALSE ) - macro_log_feature (PYTHONLIBS_FOUND "Python" - "Use Python System" - "http://www.python.org" FALSE) -#include_directories( ${PYTHON_INCLUDE_DIRS} ) + include_directories( BEFORE ${PYTHON_INCLUDE_DIR} ) -set( CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_DIRS} ${CMAKE_REQUIRED_INCLUDES} ) -check_include_file(Python.h HAVE_PYTHON_H) + LIST( APPEND + CMAKE_REQUIRED_INCLUDES ${PYTHON_INCLUDE_DIR} ${CMAKE_REQUIRED_INCLUDES}) + + check_include_file(Python.h HAVE_PYTHON_H) + + +endif(WITH_PYTHON) \ No newline at end of file diff --git a/config.h.cmake b/config.h.cmake index 02fab125e..23eb68f79 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -2036,5 +2036,30 @@ calls it, or to nothing if 'inline' is not supported under any name. */ #define free(pt) my_free(pt) #endif +#ifdef _WIN32 +#ifndef __WINDOWS__ +#define __WINDOWS__ 1 +#endif +#endif + + +/** + * X_API macro + * + * @brief Linux exports all symbols by default, but WIN32 does + * not. cmake can enable exports, using CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS + * + * @param _WIN32 + * + * @return + */ +#if _WIN32 && !defined(YAP_KERNEL) +#define X_API __declspec(dllimport) +#else +#define X_API +#endif +#define O_API + + #endif diff --git a/configure b/configure index 4c425b161..992642938 100755 --- a/configure +++ b/configure @@ -22,32 +22,37 @@ # details, see TOP_SRCDIR="$(dirname $0)" -CMAKE_CMD="cmake ${TOP_SRCDIR}" +CMAKE=cmake BUILD_TYPE="Debug" PREFIX=/usr/local LIBDIR= CMAKE_ARGS= +GENERATOR="" if [ -e "${TOP_SRCDIR}/.configure-custom.sh" ]; then . "${TOP_SRCDIR}/.configure-custom.sh" fi quote() { - echo "$1" | sed -e "s|'|'\\\\''|g; 1s/^/'/; \$s/\$/'/" + echo "$*" | sed -e "s|'|'\\\\''|g; 1s/^/'/; \$s/\$/'/" } extract_var_string() { VAR_NAME=$1 - VAR_NAME=$(echo $1 | sed -e 's/[ \t]*$//') - if [ "x$2" != "x" ]; then - VAR_VALUE=$2 - else - VAR_VALUE=yes + VAR_NAME=$(echo $1 | sed -e 's/[\\b]*$//') + + if [ "x$VAR_VALUE" = "x" ]; then + if [ "x$2" != "x" ]; then + VAR_VALUE=$2 + else + VAR_VALUE=yes + fi fi if [ "x$3" != "x" ]; then VAR_UC_NAME=$3 + VAR_UC=$(echo "$1" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_' | sed 's/_$//g') else VAR_UC_NAME=$(echo "$1" | tr '[:lower:]' '[:upper:]' | tr -c '[:alnum:]' '_' | sed 's/_$//g') fi @@ -55,35 +60,73 @@ extract_var_string() { set_config_var() { is_with=n + found=y + arg=$(echo "${2}" | tr '[:upper:]' '[:lower:]' ) case "$1" in "--enable-"*) name="${1#--enable-}" cfg="${ENABLE_VARS}" + case "x$arg" in + "xy"|"xyes"|"xtrue") + VAR_VALUE=YES + ;; + "xn"|"xno"|"xfalse") + found=y + VAR_VALUE=NO + ;; + **) + VAR_VALUE="" + ;; + esac ;; "--disable-"*) name="${1#--disable-}"; - cfg="${DISABLE_VARS}"; + cfg="${ENABLE_VARS}" + case "x$arg" in + "xy"|"xyes"|"xtrue") + VAR_VALUE=NO + ;; + "xn"|"xno"|"xfalse") + VAR_VALUE=YES + ;; + **) + VAR_VALUE="" + ;; + esac ;; "--with-"*) # IFS="=" read -ra WITHARGS <<< "${1}" name="${1#--with-}" cfg="${WITH_VARS}" - is_with=y + case "x$arg" in + "x"|"xy"|"xyes"|"xtrue"|"xon") + is_with=n + VAR_VALUE=YES + ``;; + "xn"|"xno"|"xfalse"|"xoff") + is_with=n + VAR_VALUE=NO + ;; + **) + is_with=y + VAR_VALUE="" + ;; + esac + ;; esac - found=n - for varstring in $cfg; do - extract_var_string $(echo "${varstring}" | tr '|' ' ') - if [ "x$VAR_NAME" = "x$name" ]; then - found=y - break; - fi - done + for varstring in $cfg; do + extract_var_string $(echo "${varstring}" | tr '|' ' ') + if [ "x$VAR_NAME" = "x$name" ]; then + found=y + break; + fi + done if [ "$found" = "y" ]; then if [ "x$is_with" = "xy" ]; then - CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "$2")" + CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "$VAR_VALUE") -D${VAR_UC}_ROOT_DIR=$(quote "$2")" else CMAKE_ARGS="$CMAKE_ARGS -D${VAR_UC_NAME}=$(quote "${VAR_VALUE}")" fi @@ -100,6 +143,7 @@ prefix_to_offset() { print_help() { cat <&2 -h, --help display this help and exit + --cmake=CMAKE use a specific cmake, not the default --disable-debug disable debugging mode --pass-thru pass remaining arguments through to CMake @@ -120,6 +164,8 @@ print_help() { --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/PROJECT_NAME] + + --generato=Generator Specify the tool used to send callss EOF first=y @@ -154,7 +200,6 @@ EOF fi done - first=y for varstring in ${WITH_VARS}; do if [ $first = 'y' ]; then echo "" @@ -164,6 +209,7 @@ EOF var_doc_name="WITH_${VAR_UC_NAME}_DOC" eval "docstring=\$$var_doc_name" paraminfo="${VAR_NAME}=${VAR_VALUE}" + if [ "x${docstring}" = "x" ]; then printf " --with-%-16s enable %s support\n" "$paraminfo" "$(echo -n "${VAR_NAME}" | tr '-' ' ')" else @@ -176,6 +222,10 @@ EOF while [ $# != 0 ]; do case "$1" in + "--cmake="*) + CMAKE="${1#*=}";; + "--cmake") + CMAKE="${2}"; shift;; "--prefix="*) PREFIX="${1#*=}";; "--prefix") @@ -241,6 +291,13 @@ while [ $# != 0 ]; do "--docdir") CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_INSTALL_DOCDIR=$(quote "$2")"; shift;; + "--generator="*) + GENERATOR="$CMAKE_ARGS -G $(1#*=)";; + + "-G"|"--generator") + GENERATOR="$CMAKE_ARGS -G$(quote "$2")"; + shift;; + "CC="*) CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_COMPILER=$(quote "${1#*=}")";; "CXX="*) @@ -248,7 +305,7 @@ while [ $# != 0 ]; do "CFLAGS="*) CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_C_FLAGS=$(quote "${1#*=}")";; "CXXFLAGS="*) - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_FLAGS=$(quote "${1#*=}")";; + CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_CXX_FLAGS=$(quote "${1#*=}")";; "LDFLAGS="*) LDFLAGS="$LDFLAGS ${1#*=}";; @@ -274,11 +331,13 @@ while [ $# != 0 ]; do done;; "--enable-"*) - set_config_var "$1" + name=$(echo "${1#--enable-}" | awk '{split($1,v,"="); print v[1]}') + set_config_var "--with-${name}" "${1#--enable-${name}=}" ;; "--disable-"*) - set_config_var "$1" + name=$(echo "${1#--disable-}" | awk '{split($1,v,"="); print v[1]}') + set_config_var "--with-${name}" "${1#--disable-${name}=}" ;; "--with-"*) @@ -312,4 +371,6 @@ if [ "x${LDFLAGS}" != "x" ]; then done fi -eval "cmake ${TOP_SRCDIR} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_LIBDIR=${LIBDIR} ${CMAKE_ARGS}" +CMAKE_CMD="${CMAKE} ${TOP_SRCDIR}" + +${CMAKE_CMD} "${GENERATOR}" ${TOP_SRCDIR} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${PREFIX} -DCMAKE_INSTALL_LIBDIR=${LIBDIR} ${CMAKE_ARGS} diff --git a/console/yap.c b/console/yap.c index 13b5d3920..a07ed8571 100755 --- a/console/yap.c +++ b/console/yap.c @@ -76,10 +76,9 @@ static int init_standard_system(int argc, char *argv[], YAP_init_args *iap) { YAP_file_type_t BootMode; BootMode = YAP_parse_yap_arguments(argc, argv, iap); - + iap->Embedded = false; /* init memory */ - iap->boot_file_type = - BootMode = YAP_Init(iap); + iap->boot_file_type = BootMode = YAP_Init(iap); if (iap->ErrorNo) { /* boot failed */ YAP_Error(iap->ErrorNo, 0L, iap->ErrorCause); diff --git a/docs/Doxyfile b/docs/Doxyfile index b56d7949a..b7bd6c4c3 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -785,9 +785,8 @@ INPUT = /Users/vsc/git/yap-6.3/pl \ /Users/vsc/git/yap-6.3/library \ /Users/vsc/git/yap-6.3/packages \ /Users/vsc/git/yap-6.3/swi/library \ - /Users/vsc/git/yap-6.3/docs/yap.md \ - /Users/vsc/git/yap-6.3/docs/chr.md \ - /Users/vsc/git/yap-6.3/docs/clpqr.md \ + /Users/vsc/git/yap-6.3/docs/md \ + /Users/vsc/git/yap-6.3/INSTALL.md \ # This tag can be used to specify the character encoding of the source files @@ -937,7 +936,7 @@ FILTER_SOURCE_PATTERNS = # (index.html). This can be useful if you have a project on for instance GitHub # and want to reuse the introduction page also for the doxygen output. -USE_MDFILE_AS_MAINPAGE = +USE_MDFILE_AS_MAINPAGE = #--------------------------------------------------------------------------- # Configuration options related to source browsing diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index f18062fa2..c4338c1e1 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -384,7 +384,7 @@ INLINE_GROUPED_CLASSES = NO # with only public data fields or simple typedef fields will be shown inline in # the documentation of the scope in which they are defined (i.e. file, # namespace, or group documentation), provided this scope is documented. If set -v# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# to NO, structs, classes, and unions are shown on a separate page (for HTML and # Man pages) or section (for LaTeX and RTF). # The default value is: NO. @@ -785,9 +785,8 @@ INPUT = @PROJECT_SOURCE_DIR@/pl \ @PROJECT_SOURCE_DIR@/library \ @PROJECT_SOURCE_DIR@/packages \ @PROJECT_SOURCE_DIR@/swi/library \ - @PROJECT_SOURCE_DIR@/docs/yap.md \ - @PROJECT_SOURCE_DIR@/docs/chr.md \ - @PROJECT_SOURCE_DIR@/docs/clpqr.md \ + @PROJECT_SOURCE_DIR@/docs/md \ + @PROJECT_SOURCE_DIR@/INSTALL.md # This tag can be used to specify the character encoding of the source files @@ -828,7 +827,11 @@ RECURSIVE = YES # Note that relative paths are relative to the directory from which doxygen is # run. -EXCLUDE = *pltotex.pl +EXCLUDE = *pltotex.pl \ +@PROJECT_SOURCE_DIR@/packages/myddas/sqlite3/src \ +@PROJECT_SOURCE_DIR@/packages/gecode/4.0.* \ +@PROJECT_SOURCE_DIR@/packages/gecode/3,* \ +@PROJECT_SOURCE_DIR@/C/traced_absmi_insts.h # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -1134,7 +1137,7 @@ HTML_STYLESHEET = # list). For an example see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. -HTML_EXTRA_STYLESHEET = +HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/docs/solarized-light.css # @CMAKE_SOURCE_DIR@/docs/solarized-light.css diff --git a/docs/builtins.md b/docs/builtins.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/download.md b/docs/download.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/extensions.md b/docs/extensions.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/fli.md b/docs/fli.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/install.md b/docs/install.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/docs/jquery-2.0.3.min.js b/docs/jquery-2.0.3.min.js deleted file mode 100644 index 2be209dd2..000000000 --- a/docs/jquery-2.0.3.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! jQuery v2.0.3 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license -//@ sourceMappingURL=jquery-2.0.3.min.map -*/ -(function(e,undefined){var t,n,r=typeof undefined,i=e.location,o=e.document,s=o.documentElement,a=e.jQuery,u=e.$,l={},c=[],p="2.0.3",f=c.concat,h=c.push,d=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,x=function(e,n){return new x.fn.init(e,n,t)},b=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^-ms-/,N=/-([\da-z])/gi,E=function(e,t){return t.toUpperCase()},S=function(){o.removeEventListener("DOMContentLoaded",S,!1),e.removeEventListener("load",S,!1),x.ready()};x.fn=x.prototype={jquery:p,constructor:x,init:function(e,t,n){var r,i;if(!e)return this;if("string"==typeof e){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:T.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:o,!0)),C.test(r[1])&&x.isPlainObject(t))for(r in t)x.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=o.getElementById(r[2]),i&&i.parentNode&&(this.length=1,this[0]=i),this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?n.ready(e):(e.selector!==undefined&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return d.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,t,n,r,i,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[1]||{},a=2),"object"==typeof s||x.isFunction(s)||(s={}),u===a&&(s=this,--a);u>a;a++)if(null!=(e=arguments[a]))for(t in e)n=s[t],r=e[t],s!==r&&(l&&r&&(x.isPlainObject(r)||(i=x.isArray(r)))?(i?(i=!1,o=n&&x.isArray(n)?n:[]):o=n&&x.isPlainObject(n)?n:{},s[t]=x.extend(l,o,r)):r!==undefined&&(s[t]=r));return s},x.extend({expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=a),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){(e===!0?--x.readyWait:x.isReady)||(x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(o,[x]),x.fn.trigger&&x(o).trigger("ready").off("ready")))},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray,isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if("object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(t){return!1}return!0},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:JSON.parse,parseXML:function(e){var t,n;if(!e||"string"!=typeof e)return null;try{n=new DOMParser,t=n.parseFromString(e,"text/xml")}catch(r){t=undefined}return(!t||t.getElementsByTagName("parsererror").length)&&x.error("Invalid XML: "+e),t},noop:function(){},globalEval:function(e){var t,n=eval;e=x.trim(e),e&&(1===e.indexOf("use strict")?(t=o.createElement("script"),t.text=e,o.head.appendChild(t).parentNode.removeChild(t)):n(e))},camelCase:function(e){return e.replace(k,"ms-").replace(N,E)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,s=j(e);if(n){if(s){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(s){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:function(e){return null==e?"":v.call(e)},makeArray:function(e,t){var n=t||[];return null!=e&&(j(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:g.call(t,e,n)},merge:function(e,t){var n=t.length,r=e.length,i=0;if("number"==typeof n)for(;n>i;i++)e[r++]=t[i];else while(t[i]!==undefined)e[r++]=t[i++];return e.length=r,e},grep:function(e,t,n){var r,i=[],o=0,s=e.length;for(n=!!n;s>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,s=j(e),a=[];if(s)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(a[a.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(a[a.length]=r);return f.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;return"string"==typeof t&&(n=e[t],t=e,e=n),x.isFunction(e)?(r=d.call(arguments,2),i=function(){return e.apply(t||this,r.concat(d.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):undefined},access:function(e,t,n,r,i,o,s){var a=0,u=e.length,l=null==n;if("object"===x.type(n)){i=!0;for(a in n)x.access(e,t,a,n[a],!0,o,s)}else if(r!==undefined&&(i=!0,x.isFunction(r)||(s=!0),l&&(s?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(x(e),n)})),t))for(;u>a;a++)t(e[a],n,s?r:r.call(e[a],a,t(e[a],n)));return i?e:l?t.call(e):u?t(e[0],n):o},now:Date.now,swap:function(e,t,n,r){var i,o,s={};for(o in t)s[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=s[o];return i}}),x.ready.promise=function(t){return n||(n=x.Deferred(),"complete"===o.readyState?setTimeout(x.ready):(o.addEventListener("DOMContentLoaded",S,!1),e.addEventListener("load",S,!1))),n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function j(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}t=x(o),function(e,undefined){var t,n,r,i,o,s,a,u,l,c,p,f,h,d,g,m,y,v="sizzle"+-new Date,b=e.document,w=0,T=0,C=st(),k=st(),N=st(),E=!1,S=function(e,t){return e===t?(E=!0,0):0},j=typeof undefined,D=1<<31,A={}.hasOwnProperty,L=[],q=L.pop,H=L.push,O=L.push,F=L.slice,P=L.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",W="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",$=W.replace("w","w#"),B="\\["+M+"*("+W+")"+M+"*(?:([*^$|!~]?=)"+M+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+$+")|)|)"+M+"*\\]",I=":("+W+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+B.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=RegExp("^"+M+"*,"+M+"*"),X=RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=RegExp(M+"*[+~]"),Y=RegExp("="+M+"*([^\\]'\"]*)"+M+"*\\]","g"),V=RegExp(I),G=RegExp("^"+$+"$"),J={ID:RegExp("^#("+W+")"),CLASS:RegExp("^\\.("+W+")"),TAG:RegExp("^("+W.replace("w","w*")+")"),ATTR:RegExp("^"+B),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:RegExp("^(?:"+R+")$","i"),needsContext:RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Q=/^[^{]+\{\s*\[native \w/,K=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,Z=/^(?:input|select|textarea|button)$/i,et=/^h\d$/i,tt=/'|\\/g,nt=RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),rt=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{O.apply(L=F.call(b.childNodes),b.childNodes),L[b.childNodes.length].nodeType}catch(it){O={apply:L.length?function(e,t){H.apply(e,F.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function ot(e,t,r,i){var o,s,a,u,l,f,g,m,x,w;if((t?t.ownerDocument||t:b)!==p&&c(t),t=t||p,r=r||[],!e||"string"!=typeof e)return r;if(1!==(u=t.nodeType)&&9!==u)return[];if(h&&!i){if(o=K.exec(e))if(a=o[1]){if(9===u){if(s=t.getElementById(a),!s||!s.parentNode)return r;if(s.id===a)return r.push(s),r}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(a))&&y(t,s)&&s.id===a)return r.push(s),r}else{if(o[2])return O.apply(r,t.getElementsByTagName(e)),r;if((a=o[3])&&n.getElementsByClassName&&t.getElementsByClassName)return O.apply(r,t.getElementsByClassName(a)),r}if(n.qsa&&(!d||!d.test(e))){if(m=g=v,x=t,w=9===u&&e,1===u&&"object"!==t.nodeName.toLowerCase()){f=gt(e),(g=t.getAttribute("id"))?m=g.replace(tt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",l=f.length;while(l--)f[l]=m+mt(f[l]);x=U.test(e)&&t.parentNode||t,w=f.join(",")}if(w)try{return O.apply(r,x.querySelectorAll(w)),r}catch(T){}finally{g||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,r,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>i.cacheLength&&delete t[e.shift()],t[n]=r}return t}function at(e){return e[v]=!0,e}function ut(e){var t=p.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function lt(e,t){var n=e.split("|"),r=e.length;while(r--)i.attrHandle[n[r]]=t}function ct(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function pt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return at(function(t){return t=+t,at(function(n,r){var i,o=e([],n.length,t),s=o.length;while(s--)n[i=o[s]]&&(n[i]=!(r[i]=n[i]))})})}s=ot.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},n=ot.support={},c=ot.setDocument=function(e){var t=e?e.ownerDocument||e:b,r=t.defaultView;return t!==p&&9===t.nodeType&&t.documentElement?(p=t,f=t.documentElement,h=!s(t),r&&r.attachEvent&&r!==r.top&&r.attachEvent("onbeforeunload",function(){c()}),n.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ut(function(e){return e.appendChild(t.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=ut(function(e){return e.innerHTML="
",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),n.getById=ut(function(e){return f.appendChild(e).id=v,!t.getElementsByName||!t.getElementsByName(v).length}),n.getById?(i.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){return e.getAttribute("id")===t}}):(delete i.find.ID,i.filter.ID=function(e){var t=e.replace(nt,rt);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=n.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==j?t.getElementsByTagName(e):undefined}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.CLASS=n.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==j&&h?t.getElementsByClassName(e):undefined},g=[],d=[],(n.qsa=Q.test(t.querySelectorAll))&&(ut(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll(":checked").length||d.push(":checked")}),ut(function(e){var n=t.createElement("input");n.setAttribute("type","hidden"),e.appendChild(n).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&d.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||d.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),d.push(",.*:")})),(n.matchesSelector=Q.test(m=f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&ut(function(e){n.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",I)}),d=d.length&&RegExp(d.join("|")),g=g.length&&RegExp(g.join("|")),y=Q.test(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},S=f.compareDocumentPosition?function(e,r){if(e===r)return E=!0,0;var i=r.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(r);return i?1&i||!n.sortDetached&&r.compareDocumentPosition(e)===i?e===t||y(b,e)?-1:r===t||y(b,r)?1:l?P.call(l,e)-P.call(l,r):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,n){var r,i=0,o=e.parentNode,s=n.parentNode,a=[e],u=[n];if(e===n)return E=!0,0;if(!o||!s)return e===t?-1:n===t?1:o?-1:s?1:l?P.call(l,e)-P.call(l,n):0;if(o===s)return ct(e,n);r=e;while(r=r.parentNode)a.unshift(r);r=n;while(r=r.parentNode)u.unshift(r);while(a[i]===u[i])i++;return i?ct(a[i],u[i]):a[i]===b?-1:u[i]===b?1:0},t):p},ot.matches=function(e,t){return ot(e,null,null,t)},ot.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Y,"='$1']"),!(!n.matchesSelector||!h||g&&g.test(t)||d&&d.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return ot(t,p,null,[e]).length>0},ot.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},ot.attr=function(e,t){(e.ownerDocument||e)!==p&&c(e);var r=i.attrHandle[t.toLowerCase()],o=r&&A.call(i.attrHandle,t.toLowerCase())?r(e,t,!h):undefined;return o===undefined?n.attributes||!h?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null:o},ot.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},ot.uniqueSort=function(e){var t,r=[],i=0,o=0;if(E=!n.detectDuplicates,l=!n.sortStable&&e.slice(0),e.sort(S),E){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return e},o=ot.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=ot.selectors={cacheLength:50,createPseudo:at,match:J,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(nt,rt),e[3]=(e[4]||e[5]||"").replace(nt,rt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||ot.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&ot.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return J.CHILD.test(e[0])?null:(e[3]&&e[4]!==undefined?e[2]=e[4]:n&&V.test(n)&&(t=gt(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(nt,rt).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=C[e+" "];return t||(t=RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&C(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=ot.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),s="last"!==e.slice(-4),a="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,h,d,g=o!==s?"nextSibling":"previousSibling",m=t.parentNode,y=a&&t.nodeName.toLowerCase(),x=!u&&!a;if(m){if(o){while(g){p=t;while(p=p[g])if(a?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;d=g="only"===e&&!d&&"nextSibling"}return!0}if(d=[s?m.firstChild:m.lastChild],s&&x){c=m[v]||(m[v]={}),l=c[e]||[],h=l[0]===w&&l[1],f=l[0]===w&&l[2],p=h&&m.childNodes[h];while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[w,h,f];break}}else if(x&&(l=(t[v]||(t[v]={}))[e])&&l[0]===w)f=l[1];else while(p=++h&&p&&p[g]||(f=h=0)||d.pop())if((a?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(x&&((p[v]||(p[v]={}))[e]=[w,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||ot.error("unsupported pseudo: "+e);return r[v]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?at(function(e,n){var i,o=r(e,t),s=o.length;while(s--)i=P.call(e,o[s]),e[i]=!(n[i]=o[s])}):function(e){return r(e,0,n)}):r}},pseudos:{not:at(function(e){var t=[],n=[],r=a(e.replace(z,"$1"));return r[v]?at(function(e,t,n,i){var o,s=r(e,null,i,[]),a=e.length;while(a--)(o=s[a])&&(e[a]=!(t[a]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:at(function(e){return function(t){return ot(e,t).length>0}}),contains:at(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:at(function(e){return G.test(e||"")||ot.error("unsupported lang: "+e),e=e.replace(nt,rt).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return et.test(e.nodeName)},input:function(e){return Z.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},i.pseudos.nth=i.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[t]=pt(t);for(t in{submit:!0,reset:!0})i.pseudos[t]=ft(t);function dt(){}dt.prototype=i.filters=i.pseudos,i.setFilters=new dt;function gt(e,t){var n,r,o,s,a,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);a=e,u=[],l=i.preFilter;while(a){(!n||(r=_.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=X.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(z," ")}),a=a.slice(n.length));for(s in i.filter)!(r=J[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?ot.error(e):k(e,u).slice(0)}function mt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function yt(e,t,n){var i=t.dir,o=n&&"parentNode"===i,s=T++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,a){var u,l,c,p=w+" "+s;if(a){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,a))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[v]||(t[v]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,a)||r,l[1]===!0)return!0}}function vt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,s=[],a=0,u=e.length,l=null!=t;for(;u>a;a++)(o=e[a])&&(!n||n(o,r,i))&&(s.push(o),l&&t.push(a));return s}function bt(e,t,n,r,i,o){return r&&!r[v]&&(r=bt(r)),i&&!i[v]&&(i=bt(i,o)),at(function(o,s,a,u){var l,c,p,f=[],h=[],d=s.length,g=o||Ct(t||"*",a.nodeType?[a]:a,[]),m=!e||!o&&t?g:xt(g,f,e,a,u),y=n?i||(o?e:d||r)?[]:s:m;if(n&&n(m,y,a,u),r){l=xt(y,h),r(l,[],a,u),c=l.length;while(c--)(p=l[c])&&(y[h[c]]=!(m[h[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?P.call(o,p):f[c])>-1&&(o[l]=!(s[l]=p))}}else y=xt(y===s?y.splice(d,y.length):y),i?i(null,s,y,u):O.apply(s,y)})}function wt(e){var t,n,r,o=e.length,s=i.relative[e[0].type],a=s||i.relative[" "],l=s?1:0,c=yt(function(e){return e===t},a,!0),p=yt(function(e){return P.call(t,e)>-1},a,!0),f=[function(e,n,r){return!s&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>l;l++)if(n=i.relative[e[l].type])f=[yt(vt(f),n)];else{if(n=i.filter[e[l].type].apply(null,e[l].matches),n[v]){for(r=++l;o>r;r++)if(i.relative[e[r].type])break;return bt(l>1&&vt(f),l>1&&mt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&wt(e.slice(l,r)),o>r&&wt(e=e.slice(r)),o>r&&mt(e))}f.push(n)}return vt(f)}function Tt(e,t){var n=0,o=t.length>0,s=e.length>0,a=function(a,l,c,f,h){var d,g,m,y=[],v=0,x="0",b=a&&[],T=null!=h,C=u,k=a||s&&i.find.TAG("*",h&&l.parentNode||l),N=w+=null==C?1:Math.random()||.1;for(T&&(u=l!==p&&l,r=n);null!=(d=k[x]);x++){if(s&&d){g=0;while(m=e[g++])if(m(d,l,c)){f.push(d);break}T&&(w=N,r=++n)}o&&((d=!m&&d)&&v--,a&&b.push(d))}if(v+=x,o&&x!==v){g=0;while(m=t[g++])m(b,y,l,c);if(a){if(v>0)while(x--)b[x]||y[x]||(y[x]=q.call(f));y=xt(y)}O.apply(f,y),T&&!a&&y.length>0&&v+t.length>1&&ot.uniqueSort(f)}return T&&(w=N,u=C),b};return o?at(a):a}a=ot.compile=function(e,t){var n,r=[],i=[],o=N[e+" "];if(!o){t||(t=gt(e)),n=t.length;while(n--)o=wt(t[n]),o[v]?r.push(o):i.push(o);o=N(e,Tt(i,r))}return o};function Ct(e,t,n){var r=0,i=t.length;for(;i>r;r++)ot(e,t[r],n);return n}function kt(e,t,r,o){var s,u,l,c,p,f=gt(e);if(!o&&1===f.length){if(u=f[0]=f[0].slice(0),u.length>2&&"ID"===(l=u[0]).type&&n.getById&&9===t.nodeType&&h&&i.relative[u[1].type]){if(t=(i.find.ID(l.matches[0].replace(nt,rt),t)||[])[0],!t)return r;e=e.slice(u.shift().value.length)}s=J.needsContext.test(e)?0:u.length;while(s--){if(l=u[s],i.relative[c=l.type])break;if((p=i.find[c])&&(o=p(l.matches[0].replace(nt,rt),U.test(u[0].type)&&t.parentNode||t))){if(u.splice(s,1),e=o.length&&mt(u),!e)return O.apply(r,o),r;break}}}return a(e,f)(o,t,!h,r,U.test(e)),r}n.sortStable=v.split("").sort(S).join("")===v,n.detectDuplicates=E,c(),n.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(p.createElement("div"))}),ut(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||lt("type|href|height|width",function(e,t,n){return n?undefined:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ut(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||lt("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?undefined:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||lt(R,function(e,t,n){var r;return n?undefined:(r=e.getAttributeNode(t))&&r.specified?r.value:e[t]===!0?t.toLowerCase():null}),x.find=ot,x.expr=ot.selectors,x.expr[":"]=x.expr.pseudos,x.unique=ot.uniqueSort,x.text=ot.getText,x.isXMLDoc=ot.isXML,x.contains=ot.contains}(e);var D={};function A(e){var t=D[e]={};return x.each(e.match(w)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?D[e]||A(e):x.extend({},e);var t,n,r,i,o,s,a=[],u=!e.once&&[],l=function(p){for(t=e.memory&&p,n=!0,s=i||0,i=0,o=a.length,r=!0;a&&o>s;s++)if(a[s].apply(p[0],p[1])===!1&&e.stopOnFalse){t=!1;break}r=!1,a&&(u?u.length&&l(u.shift()):t?a=[]:c.disable())},c={add:function(){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this},remove:function(){return a&&x.each(arguments,function(e,t){var n;while((n=x.inArray(t,a,n))>-1)a.splice(n,1),r&&(o>=n&&o--,s>=n&&s--)}),this},has:function(e){return e?x.inArray(e,a)>-1:!(!a||!a.length)},empty:function(){return a=[],o=0,this},disable:function(){return a=u=t=undefined,this},disabled:function(){return!a},lock:function(){return u=undefined,t||c.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!a||n&&!u||(t=t||[],t=[e,t.slice?t.slice():t],r?u.push(t):l(t)),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!n}};return c},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var s=o[0],a=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=a&&a.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[s+"With"](this===r?n.promise():this,a?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var s=o[2],a=o[3];r[o[1]]=s.add,a&&s.add(function(){n=a},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=s.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=d.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),s=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?d.call(arguments):r,n===a?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},a,u,l;if(r>1)for(a=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(s(t,l,n)).fail(o.reject).progress(s(t,u,a)):--i;return i||o.resolveWith(l,n),o.promise()}}),x.support=function(t){var n=o.createElement("input"),r=o.createDocumentFragment(),i=o.createElement("div"),s=o.createElement("select"),a=s.appendChild(o.createElement("option"));return n.type?(n.type="checkbox",t.checkOn=""!==n.value,t.optSelected=a.selected,t.reliableMarginRight=!0,t.boxSizingReliable=!0,t.pixelPosition=!1,n.checked=!0,t.noCloneChecked=n.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!a.disabled,n=o.createElement("input"),n.value="t",n.type="radio",t.radioValue="t"===n.value,n.setAttribute("checked","t"),n.setAttribute("name","t"),r.appendChild(n),t.checkClone=r.cloneNode(!0).cloneNode(!0).lastChild.checked,t.focusinBubbles="onfocusin"in e,i.style.backgroundClip="content-box",i.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===i.style.backgroundClip,x(function(){var n,r,s="padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box",a=o.getElementsByTagName("body")[0];a&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",a.appendChild(n).appendChild(i),i.innerHTML="",i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%",x.swap(a,null!=a.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===i.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(i,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(i,null)||{width:"4px"}).width,r=i.appendChild(o.createElement("div")),r.style.cssText=i.style.cssText=s,r.style.marginRight=r.style.width="0",i.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),a.removeChild(n))}),t):t}({});var L,q,H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,O=/([A-Z])/g;function F(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=x.expando+Math.random()}F.uid=1,F.accepts=function(e){return e.nodeType?1===e.nodeType||9===e.nodeType:!0},F.prototype={key:function(e){if(!F.accepts(e))return 0;var t={},n=e[this.expando];if(!n){n=F.uid++;try{t[this.expando]={value:n},Object.defineProperties(e,t)}catch(r){t[this.expando]=n,x.extend(e,t)}}return this.cache[n]||(this.cache[n]={}),n},set:function(e,t,n){var r,i=this.key(e),o=this.cache[i];if("string"==typeof t)o[t]=n;else if(x.isEmptyObject(o))x.extend(this.cache[i],t);else for(r in t)o[r]=t[r];return o},get:function(e,t){var n=this.cache[this.key(e)];return t===undefined?n:n[t]},access:function(e,t,n){var r;return t===undefined||t&&"string"==typeof t&&n===undefined?(r=this.get(e,t),r!==undefined?r:this.get(e,x.camelCase(t))):(this.set(e,t,n),n!==undefined?n:t)},remove:function(e,t){var n,r,i,o=this.key(e),s=this.cache[o];if(t===undefined)this.cache[o]={};else{x.isArray(t)?r=t.concat(t.map(x.camelCase)):(i=x.camelCase(t),t in s?r=[t,i]:(r=i,r=r in s?[r]:r.match(w)||[])),n=r.length;while(n--)delete s[r[n]]}},hasData:function(e){return!x.isEmptyObject(this.cache[e[this.expando]]||{})},discard:function(e){e[this.expando]&&delete this.cache[e[this.expando]]}},L=new F,q=new F,x.extend({acceptData:F.accepts,hasData:function(e){return L.hasData(e)||q.hasData(e)},data:function(e,t,n){return L.access(e,t,n)},removeData:function(e,t){L.remove(e,t)},_data:function(e,t,n){return q.access(e,t,n)},_removeData:function(e,t){q.remove(e,t)}}),x.fn.extend({data:function(e,t){var n,r,i=this[0],o=0,s=null;if(e===undefined){if(this.length&&(s=L.get(i),1===i.nodeType&&!q.get(i,"hasDataAttrs"))){for(n=i.attributes;n.length>o;o++)r=n[o].name,0===r.indexOf("data-")&&(r=x.camelCase(r.slice(5)),P(i,r,s[r]));q.set(i,"hasDataAttrs",!0)}return s}return"object"==typeof e?this.each(function(){L.set(this,e)}):x.access(this,function(t){var n,r=x.camelCase(e);if(i&&t===undefined){if(n=L.get(i,e),n!==undefined)return n;if(n=L.get(i,r),n!==undefined)return n;if(n=P(i,r,undefined),n!==undefined)return n}else this.each(function(){var n=L.get(this,r);L.set(this,r,t),-1!==e.indexOf("-")&&n!==undefined&&L.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){L.remove(this,e)})}});function P(e,t,n){var r;if(n===undefined&&1===e.nodeType)if(r="data-"+t.replace(O,"-$1").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n="true"===n?!0:"false"===n?!1:"null"===n?null:+n+""===n?+n:H.test(n)?JSON.parse(n):n}catch(i){}L.set(e,t,n)}else n=undefined;return n}x.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=q.get(e,t),n&&(!r||x.isArray(n)?r=q.access(e,t,x.makeArray(n)):r.push(n)),r||[]):undefined},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),s=function(){x.dequeue(e,t) -};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,s,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return q.get(e,n)||q.access(e,n,{empty:x.Callbacks("once memory").add(function(){q.remove(e,[t+"queue",n])})})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),n>arguments.length?x.queue(this[0],e):t===undefined?this:this.each(function(){var n=x.queue(this,e,t);x._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=x.Deferred(),o=this,s=this.length,a=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=undefined),e=e||"fx";while(s--)n=q.get(o[s],e+"queueHooks"),n&&n.empty&&(r++,n.empty.add(a));return a(),i.promise(t)}});var R,M,W=/[\t\r\n\f]/g,$=/\r/g,B=/^(?:input|select|textarea|button)$/i;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[x.propFix[e]||e]})},addClass:function(e){var t,n,r,i,o,s=0,a=this.length,u="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,s=0,a=this.length,u=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];a>s;s++)if(n=this[s],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(W," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,i=0,o=x(this),s=e.match(w)||[];while(t=s[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===r||"boolean"===n)&&(this.className&&q.set(this,"__className__",this.className),this.className=this.className||e===!1?"":q.get(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(W," ").indexOf(t)>=0)return!0;return!1},val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=x.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,x(this).val()):e,null==i?i="":"number"==typeof i?i+="":x.isArray(i)&&(i=x.map(i,function(e){return null==e?"":e+""})),t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&t.set(this,i,"value")!==undefined||(this.value=i))});if(i)return t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&(n=t.get(i,"value"))!==undefined?n:(n=i.value,"string"==typeof n?n.replace($,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,s=o?null:[],a=o?i+1:r.length,u=0>i?a:o?i:0;for(;a>u;u++)if(n=r[u],!(!n.selected&&u!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),s=i.length;while(s--)r=i[s],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,t,n){var i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===r?x.prop(e,t,n):(1===s&&x.isXMLDoc(e)||(t=t.toLowerCase(),i=x.attrHooks[t]||(x.expr.match.bool.test(t)?M:R)),n===undefined?i&&"get"in i&&null!==(o=i.get(e,t))?o:(o=x.find.attr(e,t),null==o?undefined:o):null!==n?i&&"set"in i&&(o=i.set(e,n,t))!==undefined?o:(e.setAttribute(t,n+""),n):(x.removeAttr(e,t),undefined))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)&&(e[r]=!1),e.removeAttribute(n)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,t,n){var r,i,o,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return o=1!==s||!x.isXMLDoc(e),o&&(t=x.propFix[t]||t,i=x.propHooks[t]),n!==undefined?i&&"set"in i&&(r=i.set(e,n,t))!==undefined?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){return e.hasAttribute("tabindex")||B.test(e.nodeName)||e.href?e.tabIndex:-1}}}}),M={set:function(e,t,n){return t===!1?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,t){var n=x.expr.attrHandle[t]||x.find.attr;x.expr.attrHandle[t]=function(e,t,r){var i=x.expr.attrHandle[t],o=r?undefined:(x.expr.attrHandle[t]=undefined)!=n(e,t,r)?t.toLowerCase():null;return x.expr.attrHandle[t]=i,o}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,t){return x.isArray(t)?e.checked=x.inArray(x(e).val(),t)>=0:undefined}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var I=/^key/,z=/^(?:mouse|contextmenu)|click/,_=/^(?:focusinfocus|focusoutblur)$/,X=/^([^.]*)(?:\.(.+)|)$/;function U(){return!0}function Y(){return!1}function V(){try{return o.activeElement}catch(e){}}x.event={global:{},add:function(e,t,n,i,o){var s,a,u,l,c,p,f,h,d,g,m,y=q.get(e);if(y){n.handler&&(s=n,n=s.handler,o=s.selector),n.guid||(n.guid=x.guid++),(l=y.events)||(l=y.events={}),(a=y.handle)||(a=y.handle=function(e){return typeof x===r||e&&x.event.triggered===e.type?undefined:x.event.dispatch.apply(a.elem,arguments)},a.elem=e),t=(t||"").match(w)||[""],c=t.length;while(c--)u=X.exec(t[c])||[],d=m=u[1],g=(u[2]||"").split(".").sort(),d&&(f=x.event.special[d]||{},d=(o?f.delegateType:f.bindType)||d,f=x.event.special[d]||{},p=x.extend({type:d,origType:m,data:i,handler:n,guid:n.guid,selector:o,needsContext:o&&x.expr.match.needsContext.test(o),namespace:g.join(".")},s),(h=l[d])||(h=l[d]=[],h.delegateCount=0,f.setup&&f.setup.call(e,i,g,a)!==!1||e.addEventListener&&e.addEventListener(d,a,!1)),f.add&&(f.add.call(e,p),p.handler.guid||(p.handler.guid=n.guid)),o?h.splice(h.delegateCount++,0,p):h.push(p),x.event.global[d]=!0);e=null}},remove:function(e,t,n,r,i){var o,s,a,u,l,c,p,f,h,d,g,m=q.hasData(e)&&q.get(e);if(m&&(u=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(a=X.exec(t[l])||[],h=g=a[1],d=(a[2]||"").split(".").sort(),h){p=x.event.special[h]||{},h=(r?p.delegateType:p.bindType)||h,f=u[h]||[],a=a[2]&&RegExp("(^|\\.)"+d.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=f.length;while(o--)c=f[o],!i&&g!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(f.splice(o,1),c.selector&&f.delegateCount--,p.remove&&p.remove.call(e,c));s&&!f.length&&(p.teardown&&p.teardown.call(e,d,m.handle)!==!1||x.removeEvent(e,h,m.handle),delete u[h])}else for(h in u)x.event.remove(e,h+t[l],n,r,!0);x.isEmptyObject(u)&&(delete m.handle,q.remove(e,"events"))}},trigger:function(t,n,r,i){var s,a,u,l,c,p,f,h=[r||o],d=y.call(t,"type")?t.type:t,g=y.call(t,"namespace")?t.namespace.split("."):[];if(a=u=r=r||o,3!==r.nodeType&&8!==r.nodeType&&!_.test(d+x.event.triggered)&&(d.indexOf(".")>=0&&(g=d.split("."),d=g.shift(),g.sort()),c=0>d.indexOf(":")&&"on"+d,t=t[x.expando]?t:new x.Event(d,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.namespace_re=t.namespace?RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=undefined,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),f=x.event.special[d]||{},i||!f.trigger||f.trigger.apply(r,n)!==!1)){if(!i&&!f.noBubble&&!x.isWindow(r)){for(l=f.delegateType||d,_.test(l+d)||(a=a.parentNode);a;a=a.parentNode)h.push(a),u=a;u===(r.ownerDocument||o)&&h.push(u.defaultView||u.parentWindow||e)}s=0;while((a=h[s++])&&!t.isPropagationStopped())t.type=s>1?l:f.bindType||d,p=(q.get(a,"events")||{})[t.type]&&q.get(a,"handle"),p&&p.apply(a,n),p=c&&a[c],p&&x.acceptData(a)&&p.apply&&p.apply(a,n)===!1&&t.preventDefault();return t.type=d,i||t.isDefaultPrevented()||f._default&&f._default.apply(h.pop(),n)!==!1||!x.acceptData(r)||c&&x.isFunction(r[d])&&!x.isWindow(r)&&(u=r[c],u&&(r[c]=null),x.event.triggered=d,r[d](),x.event.triggered=undefined,u&&(r[c]=u)),t.result}},dispatch:function(e){e=x.event.fix(e);var t,n,r,i,o,s=[],a=d.call(arguments),u=(q.get(this,"events")||{})[e.type]||[],l=x.event.special[e.type]||{};if(a[0]=e,e.delegateTarget=this,!l.preDispatch||l.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),t=0;while((i=s[t++])&&!e.isPropagationStopped()){e.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(o.namespace))&&(e.handleObj=o,e.data=o.data,r=((x.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,a),r!==undefined&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return l.postDispatch&&l.postDispatch.call(this,e),e.result}},handlers:function(e,t){var n,r,i,o,s=[],a=t.delegateCount,u=e.target;if(a&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!==this;u=u.parentNode||this)if(u.disabled!==!0||"click"!==e.type){for(r=[],n=0;a>n;n++)o=t[n],i=o.selector+" ",r[i]===undefined&&(r[i]=o.needsContext?x(i,this).index(u)>=0:x.find(i,this,null,[u]).length),r[i]&&r.push(o);r.length&&s.push({elem:u,handlers:r})}return t.length>a&&s.push({elem:this,handlers:t.slice(a)}),s},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,t){var n,r,i,s=t.button;return null==e.pageX&&null!=t.clientX&&(n=e.target.ownerDocument||o,r=n.documentElement,i=n.body,e.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),e.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),e.which||s===undefined||(e.which=1&s?1:2&s?3:4&s?2:0),e}},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,s=e,a=this.fixHooks[i];a||(this.fixHooks[i]=a=z.test(i)?this.mouseHooks:I.test(i)?this.keyHooks:{}),r=a.props?this.props.concat(a.props):this.props,e=new x.Event(s),t=r.length;while(t--)n=r[t],e[n]=s[n];return e.target||(e.target=o),3===e.target.nodeType&&(e.target=e.target.parentNode),a.filter?a.filter(e,s):e},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==V()&&this.focus?(this.focus(),!1):undefined},delegateType:"focusin"},blur:{trigger:function(){return this===V()&&this.blur?(this.blur(),!1):undefined},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&x.nodeName(this,"input")?(this.click(),!1):undefined},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==undefined&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)},x.Event=function(e,t){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.getPreventDefault&&e.getPreventDefault()?U:Y):this.type=e,t&&x.extend(this,t),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,undefined):new x.Event(e,t)},x.Event.prototype={isDefaultPrevented:Y,isPropagationStopped:Y,isImmediatePropagationStopped:Y,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=U,e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=U,e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=U,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,t,n,r,i){var o,s;if("object"==typeof e){"string"!=typeof t&&(n=n||t,t=undefined);for(s in e)this.on(s,t,n,e[s],i);return this}if(null==n&&null==r?(r=t,n=t=undefined):null==r&&("string"==typeof t?(r=n,n=undefined):(r=n,n=t,t=undefined)),r===!1)r=Y;else if(!r)return this;return 1===i&&(o=r,r=function(e){return x().off(e),o.apply(this,arguments)},r.guid=o.guid||(o.guid=x.guid++)),this.each(function(){x.event.add(this,e,r,n,t)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,x(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return(t===!1||"function"==typeof t)&&(n=t,t=undefined),n===!1&&(n=Y),this.each(function(){x.event.remove(this,e,n,t)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?x.event.trigger(e,t,n,!0):undefined}});var G=/^.[^:#\[\.,]*$/,J=/^(?:parents|prev(?:Until|All))/,Q=x.expr.match.needsContext,K={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t=x(e,this),n=t.length;return this.filter(function(){var e=0;for(;n>e;e++)if(x.contains(this,t[e]))return!0})},not:function(e){return this.pushStack(et(this,e||[],!0))},filter:function(e){return this.pushStack(et(this,e||[],!1))},is:function(e){return!!et(this,"string"==typeof e&&Q.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],s=Q.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(s?s.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?g.call(x(e),this[0]):g.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function Z(e,t){while((e=e[t])&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return Z(e,"nextSibling")},prev:function(e){return Z(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return e.contentDocument||x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(K[e]||x.unique(i),J.test(e)&&i.reverse()),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,t,n){var r=[],i=n!==undefined;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function et(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(G.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return g.call(t,e)>=0!==n})}var tt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,nt=/<([\w:]+)/,rt=/<|&#?\w+;/,it=/<(?:script|style|link)/i,ot=/^(?:checkbox|radio)$/i,st=/checked\s*(?:[^=]|=\s*.checked.)/i,at=/^$|\/(?:java|ecma)script/i,ut=/^true\/(.*)/,lt=/^\s*\s*$/g,ct={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ct.optgroup=ct.option,ct.tbody=ct.tfoot=ct.colgroup=ct.caption=ct.thead,ct.th=ct.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===undefined?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=pt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(mt(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&dt(mt(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(mt(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var t=this[0]||{},n=0,r=this.length;if(e===undefined&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!it.test(e)&&!ct[(nt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(tt,"<$1>");try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(x.cleanData(mt(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=f.apply([],e);var r,i,o,s,a,u,l=0,c=this.length,p=this,h=c-1,d=e[0],g=x.isFunction(d);if(g||!(1>=c||"string"!=typeof d||x.support.checkClone)&&st.test(d))return this.each(function(r){var i=p.eq(r);g&&(e[0]=d.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(r=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),i=r.firstChild,1===r.childNodes.length&&(r=i),i)){for(o=x.map(mt(r,"script"),ft),s=o.length;c>l;l++)a=r,l!==h&&(a=x.clone(a,!0,!0),s&&x.merge(o,mt(a,"script"))),t.call(this[l],a,l);if(s)for(u=o[o.length-1].ownerDocument,x.map(o,ht),l=0;s>l;l++)a=o[l],at.test(a.type||"")&&!q.access(a,"globalEval")&&x.contains(u,a)&&(a.src?x._evalUrl(a.src):x.globalEval(a.textContent.replace(lt,"")))}return this}}),x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=[],i=x(e),o=i.length-1,s=0;for(;o>=s;s++)n=s===o?this:this.clone(!0),x(i[s])[t](n),h.apply(r,n.get());return this.pushStack(r)}}),x.extend({clone:function(e,t,n){var r,i,o,s,a=e.cloneNode(!0),u=x.contains(e.ownerDocument,e);if(!(x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(s=mt(a),o=mt(e),r=0,i=o.length;i>r;r++)yt(o[r],s[r]);if(t)if(n)for(o=o||mt(e),s=s||mt(a),r=0,i=o.length;i>r;r++)gt(o[r],s[r]);else gt(e,a);return s=mt(a,"script"),s.length>0&&dt(s,!u&&mt(e,"script")),a},buildFragment:function(e,t,n,r){var i,o,s,a,u,l,c=0,p=e.length,f=t.createDocumentFragment(),h=[];for(;p>c;c++)if(i=e[c],i||0===i)if("object"===x.type(i))x.merge(h,i.nodeType?[i]:i);else if(rt.test(i)){o=o||f.appendChild(t.createElement("div")),s=(nt.exec(i)||["",""])[1].toLowerCase(),a=ct[s]||ct._default,o.innerHTML=a[1]+i.replace(tt,"<$1>")+a[2],l=a[0];while(l--)o=o.lastChild;x.merge(h,o.childNodes),o=f.firstChild,o.textContent=""}else h.push(t.createTextNode(i));f.textContent="",c=0;while(i=h[c++])if((!r||-1===x.inArray(i,r))&&(u=x.contains(i.ownerDocument,i),o=mt(f.appendChild(i),"script"),u&&dt(o),n)){l=0;while(i=o[l++])at.test(i.type||"")&&n.push(i)}return f},cleanData:function(e){var t,n,r,i,o,s,a=x.event.special,u=0;for(;(n=e[u])!==undefined;u++){if(F.accepts(n)&&(o=n[q.expando],o&&(t=q.cache[o]))){if(r=Object.keys(t.events||{}),r.length)for(s=0;(i=r[s])!==undefined;s++)a[i]?x.event.remove(n,i):x.removeEvent(n,i,t.handle);q.cache[o]&&delete q.cache[o]}delete L.cache[n[L.expando]]}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}});function pt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function ft(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function ht(e){var t=ut.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function dt(e,t){var n=e.length,r=0;for(;n>r;r++)q.set(e[r],"globalEval",!t||q.get(t[r],"globalEval"))}function gt(e,t){var n,r,i,o,s,a,u,l;if(1===t.nodeType){if(q.hasData(e)&&(o=q.access(e),s=q.set(t,o),l=o.events)){delete s.handle,s.events={};for(i in l)for(n=0,r=l[i].length;r>n;n++)x.event.add(t,i,l[i][n])}L.hasData(e)&&(a=L.access(e),u=x.extend({},a),L.set(t,u))}}function mt(e,t){var n=e.getElementsByTagName?e.getElementsByTagName(t||"*"):e.querySelectorAll?e.querySelectorAll(t||"*"):[];return t===undefined||t&&x.nodeName(e,t)?x.merge([e],n):n}function yt(e,t){var n=t.nodeName.toLowerCase();"input"===n&&ot.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}x.fn.extend({wrapAll:function(e){var t;return x.isFunction(e)?this.each(function(t){x(this).wrapAll(e.call(this,t))}):(this[0]&&(t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this)},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var vt,xt,bt=/^(none|table(?!-c[ea]).+)/,wt=/^margin/,Tt=RegExp("^("+b+")(.*)$","i"),Ct=RegExp("^("+b+")(?!px)[a-z%]+$","i"),kt=RegExp("^([+-])=("+b+")","i"),Nt={BODY:"block"},Et={position:"absolute",visibility:"hidden",display:"block"},St={letterSpacing:0,fontWeight:400},jt=["Top","Right","Bottom","Left"],Dt=["Webkit","O","Moz","ms"];function At(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=Dt.length;while(i--)if(t=Dt[i]+n,t in e)return t;return r}function Lt(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function qt(t){return e.getComputedStyle(t,null)}function Ht(e,t){var n,r,i,o=[],s=0,a=e.length;for(;a>s;s++)r=e[s],r.style&&(o[s]=q.get(r,"olddisplay"),n=r.style.display,t?(o[s]||"none"!==n||(r.style.display=""),""===r.style.display&&Lt(r)&&(o[s]=q.access(r,"olddisplay",Rt(r.nodeName)))):o[s]||(i=Lt(r),(n&&"none"!==n||!i)&&q.set(r,"olddisplay",i?n:x.css(r,"display"))));for(s=0;a>s;s++)r=e[s],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[s]||"":"none"));return e}x.fn.extend({css:function(e,t){return x.access(this,function(e,t,n){var r,i,o={},s=0;if(x.isArray(t)){for(r=qt(e),i=t.length;i>s;s++)o[t[s]]=x.css(e,t[s],!1,r);return o}return n!==undefined?x.style(e,t,n):x.css(e,t)},e,t,arguments.length>1)},show:function(){return Ht(this,!0)},hide:function(){return Ht(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Lt(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=vt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,s,a=x.camelCase(t),u=e.style;return t=x.cssProps[a]||(x.cssProps[a]=At(u,a)),s=x.cssHooks[t]||x.cssHooks[a],n===undefined?s&&"get"in s&&(i=s.get(e,!1,r))!==undefined?i:u[t]:(o=typeof n,"string"===o&&(i=kt.exec(n))&&(n=(i[1]+1)*i[2]+parseFloat(x.css(e,t)),o="number"),null==n||"number"===o&&isNaN(n)||("number"!==o||x.cssNumber[a]||(n+="px"),x.support.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),s&&"set"in s&&(n=s.set(e,n,r))===undefined||(u[t]=n)),undefined)}},css:function(e,t,n,r){var i,o,s,a=x.camelCase(t);return t=x.cssProps[a]||(x.cssProps[a]=At(e.style,a)),s=x.cssHooks[t]||x.cssHooks[a],s&&"get"in s&&(i=s.get(e,!0,n)),i===undefined&&(i=vt(e,t,r)),"normal"===i&&t in St&&(i=St[t]),""===n||n?(o=parseFloat(i),n===!0||x.isNumeric(o)?o||0:i):i}}),vt=function(e,t,n){var r,i,o,s=n||qt(e),a=s?s.getPropertyValue(t)||s[t]:undefined,u=e.style;return s&&(""!==a||x.contains(e.ownerDocument,e)||(a=x.style(e,t)),Ct.test(a)&&wt.test(t)&&(r=u.width,i=u.minWidth,o=u.maxWidth,u.minWidth=u.maxWidth=u.width=a,a=s.width,u.width=r,u.minWidth=i,u.maxWidth=o)),a};function Ot(e,t,n){var r=Tt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function Ft(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,s=0;for(;4>o;o+=2)"margin"===n&&(s+=x.css(e,n+jt[o],!0,i)),r?("content"===n&&(s-=x.css(e,"padding"+jt[o],!0,i)),"margin"!==n&&(s-=x.css(e,"border"+jt[o]+"Width",!0,i))):(s+=x.css(e,"padding"+jt[o],!0,i),"padding"!==n&&(s+=x.css(e,"border"+jt[o]+"Width",!0,i)));return s}function Pt(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=qt(e),s=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=vt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Ct.test(i))return i;r=s&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+Ft(e,t,n||(s?"border":"content"),r,o)+"px"}function Rt(e){var t=o,n=Nt[e];return n||(n=Mt(e,t),"none"!==n&&n||(xt=(xt||x("