libTriton version 1.0 build 1592
Loading...
Searching...
No Matches
initPrefixesNamespace.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
12
13
14
39namespace triton {
40 namespace bindings {
41 namespace python {
42
43 void initPrefixesNamespace(PyObject* prefixesDict) {
44 PyDict_Clear(prefixesDict);
45
46 PyObject* x86PrefixesDict = xPyDict_New();
47
53
54 PyObject* x86PrefixesDictClass = xPyClass_New(nullptr, x86PrefixesDict, xPyString_FromString("X86"));
55 xPyDict_SetItemString(prefixesDict, "X86", x86PrefixesDictClass);
56 }
57
58 }; /* python namespace */
59 }; /* bindings namespace */
60}; /* triton namespace */
PyObject * xPyClass_New(PyObject *b, PyObject *d, PyObject *n)
Creates a PyClass and raises an exception if it fails. dict is copied in Py3 ! All references are dec...
PyObject * xPyString_FromString(const char *v)
Creates a PyString and raises an exception if it fails.
void initPrefixesNamespace(PyObject *prefixesDict)
Initializes the PREFIX python namespace.
PyObject * xPyDict_New(void)
Creates a PyDict and raises an exception if it fails.
PyObject * PyLong_FromUint32(triton::uint32 value)
Returns a pyObject from a triton::uint32.
Definition utils.cpp:322
int xPyDict_SetItemString(PyObject *p, const char *key, PyObject *val)
Same as PyDict_SetItemString but decrements reference on object.
@ ID_PREFIX_REPNE
REPNE.
@ ID_PREFIX_INVALID
invalid
The Triton namespace.