1*5f7ddb14SDimitry Andric //===-- ScriptInterpreterPython.h -------------------------------*- C++ -*-===//
2*5f7ddb14SDimitry Andric //
3*5f7ddb14SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*5f7ddb14SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*5f7ddb14SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*5f7ddb14SDimitry Andric //
7*5f7ddb14SDimitry Andric //===----------------------------------------------------------------------===//
8*5f7ddb14SDimitry Andric 
9*5f7ddb14SDimitry Andric #ifndef LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H
10*5f7ddb14SDimitry Andric #define LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H
11*5f7ddb14SDimitry Andric 
12*5f7ddb14SDimitry Andric #include <string>
13*5f7ddb14SDimitry Andric 
14*5f7ddb14SDimitry Andric #include "lldb/Host/Config.h"
15*5f7ddb14SDimitry Andric 
16*5f7ddb14SDimitry Andric #if LLDB_ENABLE_PYTHON
17*5f7ddb14SDimitry Andric 
18*5f7ddb14SDimitry Andric #include "lldb/lldb-forward.h"
19*5f7ddb14SDimitry Andric #include "lldb/lldb-types.h"
20*5f7ddb14SDimitry Andric 
21*5f7ddb14SDimitry Andric namespace lldb_private {
22*5f7ddb14SDimitry Andric 
23*5f7ddb14SDimitry Andric // GetPythonValueFormatString provides a system independent type safe way to
24*5f7ddb14SDimitry Andric // convert a variable's type into a python value format. Python value formats
25*5f7ddb14SDimitry Andric // are defined in terms of builtin C types and could change from system to as
26*5f7ddb14SDimitry Andric // the underlying typedef for uint* types, size_t, off_t and other values
27*5f7ddb14SDimitry Andric // change.
28*5f7ddb14SDimitry Andric 
29*5f7ddb14SDimitry Andric template <typename T> const char *GetPythonValueFormatString(T t);
30*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(char *);
31*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(char);
32*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(unsigned char);
33*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(short);
34*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(unsigned short);
35*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(int);
36*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(unsigned int);
37*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(long);
38*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(unsigned long);
39*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(long long);
40*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(unsigned long long);
41*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(float t);
42*5f7ddb14SDimitry Andric template <> const char *GetPythonValueFormatString(double t);
43*5f7ddb14SDimitry Andric 
44*5f7ddb14SDimitry Andric extern "C" void *LLDBSwigPythonCreateScriptedProcess(
45*5f7ddb14SDimitry Andric     const char *python_class_name, const char *session_dictionary_name,
46*5f7ddb14SDimitry Andric     const lldb::TargetSP &target_sp, StructuredDataImpl *args_impl,
47*5f7ddb14SDimitry Andric     std::string &error_string);
48*5f7ddb14SDimitry Andric 
49*5f7ddb14SDimitry Andric extern "C" void *LLDBSWIGPython_CastPyObjectToSBData(void *data);
50*5f7ddb14SDimitry Andric extern "C" void *LLDBSWIGPython_CastPyObjectToSBError(void *data);
51*5f7ddb14SDimitry Andric extern "C" void *LLDBSWIGPython_CastPyObjectToSBValue(void *data);
52*5f7ddb14SDimitry Andric 
53*5f7ddb14SDimitry Andric } // namespace lldb_private
54*5f7ddb14SDimitry Andric 
55*5f7ddb14SDimitry Andric #endif // LLDB_ENABLE_PYTHON
56*5f7ddb14SDimitry Andric #endif // LLDB_PLUGINS_SCRIPTINTERPRETER_PYTHON_SWIGPYTHONBRIDGE_H
57