#include "include/dvr/dvr_api.h" #include #include // Headers from libdvr #include #include #include #include #include // Headers not yet moved into libdvr. // TODO(jwcai) Move these once their callers are moved into Google3. #include #include #include extern "C" { int dvrGetApi(void* api, size_t struct_size, int version) { ALOGI("dvrGetApi: api=%p struct_size=%zu version=%d", api, struct_size, version); if (version == 1) { if (struct_size != sizeof(DvrApi_v1)) { ALOGE("dvrGetApi: Size mismatch: expected %zu; actual %zu", sizeof(DvrApi_v1), struct_size); return -EINVAL; } DvrApi_v1* dvr_api = static_cast(api); // Defines an API entry for V1 (no version suffix). #define DVR_V1_API_ENTRY(name) dvr_api->name = dvr##name #include "include/dvr/dvr_api_entries.h" // Undefine macro definitions to play nice with Google3 style rules. #undef DVR_V1_API_ENTRY return 0; } ALOGE("dvrGetApi: Unknown API version=%d", version); return -EINVAL; } } // extern "C"