6 tep_is_bigendian, tep_is_local_bigendian, tep_set_local_bigendian - Get / set
7 the endianness of the local machine.
13 *#include <event-parse.h>*
16 TEP_LITTLE_ENDIAN = 0,
20 int *tep_is_bigendian*(void);
21 bool *tep_is_local_bigendian*(struct tep_handle pass:[*]_tep_);
22 void *tep_set_local_bigendian*(struct tep_handle pass:[*]_tep_, enum tep_endian _endian_);
28 The _tep_is_bigendian()_ gets the endianness of the machine, executing
31 The _tep_is_local_bigendian()_ function gets the endianness of the local
32 machine, saved in the _tep_ handler. The _tep_ argument is the trace event
33 parser context. This API is a bit faster than _tep_is_bigendian()_, as it
34 returns cached endianness of the local machine instead of checking it each time.
36 The _tep_set_local_bigendian()_ function sets the endianness of the local
37 machine in the _tep_ handler. The _tep_ argument is trace event parser context.
38 The _endian_ argument is the endianness:
41 _TEP_LITTLE_ENDIAN_ - the machine is little endian,
42 _TEP_BIG_ENDIAN_ - the machine is big endian.
47 The _tep_is_bigendian()_ function returns non zero if the endianness of the
48 machine, executing the code, is big endian and zero otherwise.
50 The _tep_is_local_bigendian()_ function returns true, if the endianness of the
51 local machine, saved in the _tep_ handler, is big endian, or false otherwise.
57 #include <event-parse.h>
59 struct tep_handle *tep = tep_alloc();
61 if (tep_is_bigendian())
62 tep_set_local_bigendian(tep, TEP_BIG_ENDIAN);
64 tep_set_local_bigendian(tep, TEP_LITTLE_ENDIAN);
66 if (tep_is_local_bigendian(tep))
67 printf("This machine you are running on is bigendian\n");
69 printf("This machine you are running on is little endian\n");
78 Header file to include in order to have access to the library APIs.
80 Linker switch to add when building a program that uses the library.
85 _libtraceevent(3)_, _trace-cmd(1)_
91 *Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
92 *Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
96 Report bugs to <linux-trace-devel@vger.kernel.org>
100 libtraceevent is Free Software licensed under the GNU LGPL 2.1
104 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git