dyn_struct_alloc.h File Reference
#include <fio/public/version.h>
#include <fio/public/common_types.h>
#include <string.h>
Go to the source code of this file.
Defines |
#define | FIO_STRUCT_INIT(obj, version) |
| Sets up an input structure for calling a Fusion-io SDK function. Since this macro is compiled with the version of the SDK that your application is built against, it will mean that your application is guaranteed to work with future versions of the SDK without needing to be rebuilt. New data elements that appear in later versions of the SDK will not be populated for applications built against older versions of the SDK.
|
#define | FIO_STRUCT_VERSION_OK(obj, min_version) (((obj)->lib_version) >= (min_version)) |
| Verifies that the version of the passed-in struct is at least the passed-in version. Used to protect elements of a struct from being set if passed from an older caller.
|
Define Documentation
#define FIO_STRUCT_INIT |
( |
obj, |
|
|
version |
|
) |
|
Value:memset(&(obj), 0, sizeof(obj)); \
(obj).lib_version = (uint32_t)version;
Sets up an input structure for calling a Fusion-io SDK function. Since this macro is compiled with the version of the SDK that your application is built against, it will mean that your application is guaranteed to work with future versions of the SDK without needing to be rebuilt. New data elements that appear in later versions of the SDK will not be populated for applications built against older versions of the SDK.
Internally it memsets the input structure to 0's and populate the version. Version is always the first element of every input structure and is a uint_32
- Parameters:
-
| obj | The structure to initialize. |
| version | The version to initialize the structure to. This should be set to FIO_SDK_API_VERSION. |
#define FIO_STRUCT_VERSION_OK |
( |
obj, |
|
|
min_version |
|
) |
(((obj)->lib_version) >= (min_version)) |
Verifies that the version of the passed-in struct is at least the passed-in version. Used to protect elements of a struct from being set if passed from an older caller.
- Parameters:
-
| obj | Pointer to structure which may or may not have newer elements than 'version'. |
| min_version | Minimum version required by the protected elements. |
- Returns:
- true if the version of the struct is greater than or equal to the passed-in version, otherwise returns false.