NuSMV/code/nusmv/core/utils/defs.h File Reference
#include <assert.h>
#include "cudd/util.h"
#include <time.h>
Go to the source code of this file.
Defines |
#define | COMMA_OPERATOR , |
#define | ENUM_CHECK(value, first, last) nusmv_assert(first < value && value < last) |
#define | FALLTHROUGH |
| for switch cases without break
|
#define | MACRO_STRINGIZE(x) MACRO_STRINGIZE_2nd_LEVEL(x) |
#define | MACRO_STRINGIZE_2nd_LEVEL(x) #x |
#define | max(_a_, _b_) ((_a_ < _b_) ? _b_ : _a_) |
#define | min(_a_, _b_) ((_a_ < _b_) ? _a_ : _b_) |
#define | NIL_PTR(ptr_type) ((ptr_type) NULL) |
#define | NORETURN |
| Some low-level definitions.
|
#define | nusmv_assert(expr) assert(expr) |
#define | PRIdMAX "ld" |
#define | PRIdPTR "d" |
#define | PRIoMAX "lo" |
#define | PRIuMAX "lu" |
| Fallback definition of PRI...MAX in case of missing <inttypes.h>. To be used as format specifier when printing unsigned long long int.
|
#define | PRIuPTR "u" |
| This is a portable prefix to print size_t valus with printf.
|
#define | PRIXMAX "lX" |
#define | PTR_FROM_INT(ptr, x) ((ptr) (nusmv_ptrint) (x)) |
| Casts the given int to the given pointer type.
|
#define | PTR_TO_INT(x) ((int) (nusmv_ptrint) (x)) |
| Casts the given pointer (address) to an int.
|
#define | THROWS_EXCEPTION |
#define | UNUSED_PARAM(x) (void)(x) |
#define | UNUSED_VAR(x) (void)(x) |
#define | utils_random() rand() |
#define | utils_random_set_seed() srand((unsigned int)time(NULL)) |
#define | VOIDPTR_FROM_INT(x) ((void *) (nusmv_ptrint) (x)) |
| Casts the given int to void *.
|
Typedefs |
typedef util_ptrint | nusmv_ptrint |
typedef util_ptruint | nusmv_ptruint |
typedef int(* | PFIVPVP )(const void *, const void *) |
typedef void *(* | PFVPVPVP )(void *, void *) |
Enumerations |
enum | boolean { false = 0,
true = 1
} |
enum | Outcome {
OUTCOME_GENERIC_ERROR,
OUTCOME_PARSER_ERROR,
OUTCOME_SYNTAX_ERROR,
OUTCOME_FILE_ERROR,
OUTCOME_SUCCESS_REQUIRED_HELP,
OUTCOME_SUCCESS
} |
Define Documentation
#define ENUM_CHECK |
( |
value, |
|
|
first, |
|
|
last |
|
) |
nusmv_assert(first < value && value < last) |
for switch cases without break
#define MACRO_STRINGIZE |
( |
x |
|
) |
MACRO_STRINGIZE_2nd_LEVEL(x) |
#define MACRO_STRINGIZE_2nd_LEVEL |
( |
x |
|
) |
#x |
#define max |
( |
_a_, |
|
|
_b_ |
|
) |
((_a_ < _b_) ? _b_ : _a_) |
#define min |
( |
_a_, |
|
|
_b_ |
|
) |
((_a_ < _b_) ? _a_ : _b_) |
#define NIL_PTR |
( |
ptr_type |
|
) |
((ptr_type) NULL) |
Some low-level definitions.
- Author:
- Roberto Cavada Some low-level definitions
#define nusmv_assert |
( |
expr |
|
) |
assert(expr) |
Fallback definition of PRI...MAX in case of missing <inttypes.h>. To be used as format specifier when printing unsigned long long int.
- Todo:
- Missing description
- See also:
- Documentation of <inttypes.h>
This is a portable prefix to print size_t valus with printf.
Use this prefix when printinf size_t values with printf. Warning! This macro is not prefixed with ''
Casts the given int to the given pointer type.
Casts the given pointer (address) to an int.
#define UNUSED_PARAM |
( |
x |
|
) |
(void)(x) |
#define UNUSED_VAR |
( |
x |
|
) |
(void)(x) |
#define utils_random |
( |
|
) |
rand() |
#define utils_random_set_seed |
( |
|
) |
srand((unsigned int)time(NULL)) |
#define VOIDPTR_FROM_INT |
( |
x |
|
) |
((void *) (nusmv_ptrint) (x)) |
Casts the given int to void *.
Typedef Documentation
typedef int(* PFIVPVP)(const void *, const void *) |
typedef void*(* PFVPVPVP)(void *, void *) |
Enumeration Type Documentation
- Enumerator:
OUTCOME_GENERIC_ERROR |
|
OUTCOME_PARSER_ERROR |
|
OUTCOME_SYNTAX_ERROR |
|
OUTCOME_FILE_ERROR |
|
OUTCOME_SUCCESS_REQUIRED_HELP |
|
OUTCOME_SUCCESS |
|