Inkscape
Vector Graphics Editor
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
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
j
k
l
m
n
o
p
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
Enumerator
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
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
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
z
~
Variables
_
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
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
x
y
Enumerations
a
b
c
d
e
f
g
h
i
k
l
m
o
p
r
s
t
u
w
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
y
Related Symbols
:
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
v
w
Files
File List
File Members
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
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
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
Typedefs
_
a
b
c
d
e
f
g
h
i
l
n
p
q
r
s
t
u
Enumerations
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
r
s
t
u
Enumerator
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
x
y
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Modules
Pages
Concepts
Loading...
Searching...
No Matches
xstd.h
Go to the documentation of this file.
1
/* xstd.h: Wrappers for functions in C standard library
2
Was: xmem, xfile */
3
4
/* These call the corresponding function in the standard library, and
5
abort if those routines fail. */
6
7
#ifndef XSTD_H
8
#define XSTD_H
9
10
#include "
types.h
"
11
#include <assert.h>
12
#include <stdlib.h>
13
14
/*
15
* XMEM
16
*/
17
#ifndef __cplusplus
18
#define XMALLOC(new_mem, size) \
19
do \
20
{ \
21
assert(size); \
22
new_mem = (gpointer) malloc (size); \
23
assert(new_mem); \
24
} while (0)
25
26
#define XCALLOC(new_mem, size) \
27
do \
28
{ \
29
assert(size); \
30
new_mem = (gpointer) calloc (size, 1); \
31
assert(new_mem); \
32
} while (0)
33
34
#define XREALLOC(old_ptr, size) \
35
do \
36
{ \
37
gpointer new_mem; \
38
\
39
if (old_ptr == NULL) \
40
XMALLOC (new_mem, size); \
41
else \
42
{ \
43
new_mem = (gpointer) realloc (old_ptr, size); \
44
assert(new_mem); \
45
} \
46
\
47
old_ptr = new_mem; \
48
} while (0)
49
50
#else
51
/* Use templates if Cplusplus... */
52
#define XMALLOC(new_mem, size) \
53
do \
54
{ \
55
assert(size); \
56
(gpointer&)(new_mem) = (gpointer) malloc (size); \
57
assert(new_mem); \
58
} while (0)
59
60
#define XCALLOC(new_mem, sizex) \
61
do \
62
{ \
63
assert(sizex); \
64
(gpointer&)(new_mem) = (void *) calloc (sizex, 1); \
65
assert(new_mem); \
66
} while (0)
67
68
#define XREALLOC(old_ptr, size) \
69
do \
70
{ \
71
gpointer new_mem; \
72
\
73
if (old_ptr == NULL) \
74
XMALLOC (new_mem, (size)); \
75
else \
76
{ \
77
(gpointer&) new_mem = (gpointer) realloc ((old_ptr), (size)); \
78
assert(new_mem); \
79
} \
80
\
81
(gpointer&)old_ptr = new_mem; \
82
} while (0)
83
#endif
84
85
#endif
/* Not XSTD_H */
types.h
src
3rdparty
autotrace
xstd.h
Generated on Sun Mar 16 2025 04:01:01 for Inkscape by
1.9.8