Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
PyzPythonHelpers.cxx
Go to the documentation of this file.
1// Author: Stefan Wunsch CERN 08/2018
2// Original PyROOT code by Wim Lavrijsen, LBL
3
4/*************************************************************************
5 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/**
13
14Set of helper functions that are invoked from the pythonizors, on the
15Python side. For that purpose, they are included in the interface of the
16PyROOT extension module.
17
18*/
19
20#include "CPyCppyy/API.h"
21
22#include "PyROOTPythonize.h"
23
24#include "ROOT/RConfig.hxx"
25#include "TInterpreter.h"
26
27#include <sstream>
28
29////////////////////////////////////////////////////////////////////////////
30/// \brief Get endianess of the system
31/// \param[in] self Always null, since this is a module function.
32/// \param[in] args Pointer to an empty Python tuple.
33/// \return Endianess as Python string
34///
35/// This function returns endianess of the system as a Python integer. The
36/// return value is either '<' or '>' for little or big endian, respectively.
37PyObject *PyROOT::GetEndianess(PyObject * /* self */, PyObject * /* args */)
38{
39#ifdef R__BYTESWAP
40 return PyUnicode_FromString("<");
41#else
42 return PyUnicode_FromString(">");
43#endif
44}
_object PyObject
PyObject * GetEndianess(PyObject *self, PyObject *args)
Set of helper functions that are invoked from the pythonizors, on the Python side.