[wpiutil] DataLog: Add AddSchema functions to C API (#6232)

This commit is contained in:
Thad House
2024-01-15 23:34:18 -08:00
committed by GitHub
parent 30965b20cf
commit a2d45dbca4
2 changed files with 23 additions and 0 deletions

View File

@@ -1205,4 +1205,18 @@ void WPI_DataLog_AppendStringArray(struct WPI_DataLog* datalog, int entry,
timestamp);
}
void WPI_DataLog_AddSchemaString(struct WPI_DataLog* datalog, int entry,
const char* name, const char* type,
const char* schema, int64_t timestamp) {
reinterpret_cast<DataLog*>(datalog)->AddSchema(name, type, schema, timestamp);
}
void WPI_DataLog_AddSchema(struct WPI_DataLog* datalog, int entry,
const char* name, const char* type,
const uint8_t* schema, size_t schema_len,
int64_t timestamp) {
reinterpret_cast<DataLog*>(datalog)->AddSchema(
name, type, std::span<const uint8_t>{schema, schema_len}, timestamp);
}
} // extern "C"