GRASS GIS 8 Programmer's Manual
8.5.0dev(2025)-565e82de51
Main Page
Related Pages
Data Structures
Data Structures
Class Hierarchy
Data Fields
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
Files
File List
Globals
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
Enumerations
a
c
d
e
h
i
j
l
m
n
o
p
r
s
t
v
y
Enumerator
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
y
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
endian.c
Go to the documentation of this file.
1
/*!
2
* \file lib/gis/endian.c
3
*
4
* \brief GIS Library - Functions to determine architecture endian.
5
*
6
* This endian test was taken from ./src.contrib/GMSL/NVIZ2.2/TOGL/apps/image.c.
7
*
8
* (C) 2001-2009 by the GRASS Development Team
9
*
10
* This program is free software under the GNU General Public License
11
* (>=v2). Read the file COPYING that comes with GRASS for details.
12
*
13
* \author Markus Neteler
14
*/
15
16
/*!
17
* \brief Tests for little ENDIAN.
18
*
19
* Test if machine is little or big endian.
20
*
21
* \return 1 little endian
22
* \return 0 big endian
23
*/
24
int
G_is_little_endian
(
void
)
25
{
26
union
{
27
int
testWord;
28
char
testByte[
sizeof
(int)];
29
} endianTest;
30
31
endianTest.testWord = 1;
32
33
if
(endianTest.testByte[0] == 1)
34
return
1;
/* true: little endian */
35
36
return
0;
/* false: big endian */
37
}
G_is_little_endian
int G_is_little_endian(void)
Tests for little ENDIAN.
Definition:
endian.c:24
lib
gis
endian.c
Generated on Thu Mar 20 2025 07:33:24 for GRASS GIS 8 Programmer's Manual by
1.9.1