libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
initVersionNamespace.cpp
Go to the documentation of this file.
1
2/*
3** Copyright (C) - Triton
4**
5** This program is under the terms of the Apache License 2.0.
6*/
7
8#include <triton/config.hpp>
12#include <triton/version.hpp>
13
14
15
40namespace triton {
41 namespace bindings {
42 namespace python {
43
44 void initVersionNamespace(PyObject* versionDict) {
45 xPyDict_SetItemString(versionDict, "MAJOR", PyLong_FromUint32(triton::MAJOR));
46 xPyDict_SetItemString(versionDict, "MINOR", PyLong_FromUint32(triton::MINOR));
47 xPyDict_SetItemString(versionDict, "BUILD", PyLong_FromUint32(triton::BUILD));
48
49 #ifdef TRITON_Z3_INTERFACE
50 Py_INCREF(Py_True);
51 xPyDict_SetItemString(versionDict, "Z3_INTERFACE", Py_True);
52 #else
53 Py_INCREF(Py_False);
54 xPyDict_SetItemString(versionDict, "Z3_INTERFACE", Py_False);
55 #endif
56
57 #ifdef TRITON_BITWUZLA_INTERFACE
58 Py_INCREF(Py_True);
59 xPyDict_SetItemString(versionDict, "BITWUZLA_INTERFACE", Py_True);
60 #else
61 Py_INCREF(Py_False);
62 xPyDict_SetItemString(versionDict, "BITWUZLA_INTERFACE", Py_False);
63 #endif
64
65 #ifdef TRITON_LLVM_INTERFACE
66 Py_INCREF(Py_True);
67 xPyDict_SetItemString(versionDict, "LLVM_INTERFACE", Py_True);
68 #else
69 Py_INCREF(Py_False);
70 xPyDict_SetItemString(versionDict, "LLVM_INTERFACE", Py_False);
71 #endif
72 }
73
74 }; /* python namespace */
75 }; /* bindings namespace */
76}; /* triton namespace */
PyObject * PyLong_FromUint32(triton::uint32 value)
Returns a pyObject from a triton::uint32.
Definition utils.cpp:322
void initVersionNamespace(PyObject *versionDict)
Initializes the VERSION python namespace.
int xPyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
Same as PyDict_SetItemString but decrements reference on object.
The Triton namespace.