#include "xmalloc.h"
Idź do kodu źródłowego tego pliku.
Definicje |
#define | PROPERTY_INT_GET(object, property, type) |
#define | PROPERTY_INT_SET(object, property, type) |
#define | PROPERTY_INT(object, property, type) |
#define | PROPERTY_STRING_GET(object, property) |
#define | PROPERTY_STRING_SET(object, property) |
#define | PROPERTY_STRING(object, property) |
#define | PROPERTY_PRIVATE_GET(object) |
#define | PROPERTY_PRIVATE_SET(object) |
#define | PROPERTY_PRIVATE(object) |
#define | PROPERTY_MISC_GET(object, property, type, null) |
#define | PROPERTY_MISC_SET(object, property, type) |
#define | PROPERTY_MISC(object, property, type, null) |
Dokumentacja definicji
#define PROPERTY_INT |
( |
|
object, |
|
|
|
property, |
|
|
|
type |
|
) |
| |
#define PROPERTY_INT_GET |
( |
|
object, |
|
|
|
property, |
|
|
|
type |
|
) |
| |
Wartość:\
type object##_##property##_get(object##_t *o) \
{ \
return (o) ? o->property : -1; \
}
#define PROPERTY_INT_SET |
( |
|
object, |
|
|
|
property, |
|
|
|
type |
|
) |
| |
Wartość:\
int object##_##property##_set(object##_t *o, type v) \
{ \
if (!o) \
return -1; \
\
o->property = v; \
\
return 0; \
}
#define PROPERTY_MISC |
( |
|
object, |
|
|
|
property, |
|
|
|
type, |
|
|
|
null |
|
) |
| |
#define PROPERTY_MISC_GET |
( |
|
object, |
|
|
|
property, |
|
|
|
type, |
|
|
|
null |
|
) |
| |
Wartość:\
type object##_##property##_get(object##_t *o) \
{ \
return (o) ? o->property : null; \
}
#define PROPERTY_MISC_SET |
( |
|
object, |
|
|
|
property, |
|
|
|
type |
|
) |
| |
Wartość:\
int object##_##property##_set(object##_t *o, type v) \
{ \
if (!o) \
return -1; \
\
o->property = v; \
\
return 0; \
}
#define PROPERTY_PRIVATE |
( |
|
object | ) |
|
#define PROPERTY_PRIVATE_GET |
( |
|
object | ) |
|
Wartość:\
void *object##_private_get(object##_t *o) \
{ \
return (o) ? o->priv : NULL; \
}
#define PROPERTY_PRIVATE_SET |
( |
|
object | ) |
|
Wartość:\
int object##_private_set(object##_t *o, void *v) \
{ \
if (!o) \
return -1; \
\
o->priv = v; \
\
return 0; \
}
#define PROPERTY_STRING |
( |
|
object, |
|
|
|
property |
|
) |
| |
#define PROPERTY_STRING_GET |
( |
|
object, |
|
|
|
property |
|
) |
| |
Wartość:\
const char *object##_##property##_get(object##_t *o) \
{ \
return (o) ? o->property : NULL; \
}
#define PROPERTY_STRING_SET |
( |
|
object, |
|
|
|
property |
|
) |
| |
Wartość:\
int object##_##property##_set(object##_t *o, const char *v) \
{ \
if (!o) \
return -1; \
\
xfree(o->property); \
o->property = xstrdup(v); \
\
return 0; \
}