bootstrap/include/validator.h

25 lines
456 B
C
Raw Normal View History

2023-11-24 17:27:44 +00:00
#ifndef _BOOTSTRAP_VALIDATOR_H
#define _BOOTSTRAP_VALIDATOR_H
#include "cJSON.h"
#include "dyn_array.h"
#include "error.h"
2023-11-24 17:27:44 +00:00
enum FieldType {
FT_STRING = 1,
2023-11-24 17:27:44 +00:00
};
struct Field {
enum FieldType type;
2023-11-25 17:37:41 +00:00
// OWNERSHIP: Does not take ownership.
2023-11-24 17:27:44 +00:00
const char *key;
2023-11-25 17:37:41 +00:00
// OWNERSHIP: Does not take ownership.
const char *prompt;
2023-11-24 17:27:44 +00:00
};
struct Error *validate_spec_json(
2023-11-25 02:35:22 +00:00
const cJSON *const parsed, struct DynArray **fields
);
2023-11-24 17:27:44 +00:00
#endif /* _BOOTSTRAP_VALIDATOR_H */