27 lines
663 B
C
27 lines
663 B
C
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include "../../ffi/medicallib.h"
|
|
|
|
int main(void) {
|
|
float bmi = 0.0f;
|
|
if (medicallib_bmi(70.0f, 1.75f, &bmi) != ML_OK) {
|
|
fprintf(stderr, "BMI error\n");
|
|
return 1;
|
|
}
|
|
printf("BMI: %.2f\n", bmi);
|
|
|
|
MLPatient* p = ml_patient_new("ffi-01");
|
|
if (!p) { fprintf(stderr, "patient new failed\n"); return 1; }
|
|
ml_patient_update(p, 0.5f);
|
|
|
|
char* sum = ml_patient_summary(p);
|
|
if (sum) { printf("%s\n", sum); ml_string_free(sum); }
|
|
|
|
char* h = ml_patient_organ_summary(p, ML_ORGAN_HEART);
|
|
if (h) { printf("%s\n", h); ml_string_free(h); }
|
|
|
|
ml_patient_free(p);
|
|
return 0;
|
|
}
|
|
|