Skip to content

Commit

Permalink
Merge pull request #125 from VorpalBlade/bugfix/constant-changes
Browse files Browse the repository at this point in the history
Fixes for changed constants.
  • Loading branch information
yuce authored Sep 1, 2021
2 parents 35ddce7 + 1b44780 commit 8fca318
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Dylan Lukes
Guglielmo Gemignani
Vince Jankovics
Tobias Grubenmann
Arvid Norlander
59 changes: 42 additions & 17 deletions pyswip/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,23 +755,48 @@ def check_and_call(*args):
# * CHAR BUFFERS *
# *******************************/

CVT_ATOM = 0x0001
CVT_STRING = 0x0002
CVT_LIST = 0x0004
CVT_INTEGER = 0x0008
CVT_FLOAT = 0x0010
CVT_VARIABLE = 0x0020
CVT_NUMBER = CVT_INTEGER | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x0040 # as of version 3.2.10
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00ff

BUF_DISCARDABLE = 0x0000
BUF_RING = 0x0100
BUF_MALLOC = 0x0200

CVT_EXCEPTION = 0x10000 # throw exception on error
# Changed in 8.1.22
if PL_VERSION < 80122:
CVT_ATOM = 0x0001
CVT_STRING = 0x0002
CVT_LIST = 0x0004
CVT_INTEGER = 0x0008
CVT_FLOAT = 0x0010
CVT_VARIABLE = 0x0020
CVT_NUMBER = CVT_INTEGER | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x0040 # as of version 3.2.10
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00ff

BUF_DISCARDABLE = 0x0000
BUF_RING = 0x0100
BUF_MALLOC = 0x0200

CVT_EXCEPTION = 0x10000 # throw exception on error
else:
CVT_ATOM = 0x00000001
CVT_STRING = 0x00000002
CVT_LIST = 0x00000004
CVT_INTEGER = 0x00000008
CVT_RATIONAL = 0x00000010
CVT_FLOAT = 0x00000020
CVT_VARIABLE = 0x00000040
CVT_NUMBER = CVT_RATIONAL | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x00000080
CVT_WRITE_CANONICAL = 0x00000080
CVT_WRITEQ = 0x000000C0
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00000fff

BUF_DISCARDABLE = 0x00000000
BUF_STACK = 0x00010000
BUF_RING = BUF_STACK
BUF_MALLOC = 0x00020000
BUF_ALLOW_STACK = 0x00040000

CVT_EXCEPTION = 0x00001000 # throw exception on error



Expand Down

0 comments on commit 8fca318

Please sign in to comment.