28 lines
844 B
C
28 lines
844 B
C
#ifndef __GARGOYLE_SLEUTH_H_
|
|
#define __GARGOYLE_SLEUTH_H_
|
|
|
|
#include <stdint.h>
|
|
|
|
static const uint8_t GARGOYLE_TYPE_UINT = 1 << 0;
|
|
static const uint8_t GARGOYLE_TYPE_BOOL = 1 << 1;
|
|
static const uint8_t GARGOYLE_TYPE_FILE = 1 << 2;
|
|
static const uint8_t GARGOYLE_TYPE_ROPE = 1 << 3;
|
|
static const uint8_t GARGOYLE_TYPE_DBLE = 1 << 4;
|
|
|
|
struct gargoyle_opt {
|
|
const char *brand;
|
|
uint16_t brand_sz;
|
|
const char emblem;
|
|
void *val;
|
|
uint16_t val_sz;
|
|
uint8_t type;
|
|
};
|
|
|
|
#define GARGOYLE_MK_OPT(brand) brand, (sizeof(brand) - 1)
|
|
#define GARGOYLE_EZ_OPT(brand, val) brand, (sizeof(brand) - 1), 0[brand] /* >:) */, &val, sizeof(val)
|
|
|
|
struct gargoyle_opt *gargoyle_find_brand(uint16_t optc, struct gargoyle_opt *optv, const char *brand);
|
|
struct gargoyle_opt *gargoyle_find_emblem(uint16_t optc, struct gargoyle_opt *optv, const char emblem);
|
|
|
|
#endif
|