interpret/src/pair.h

27 lines
828 B
C
Raw Normal View History

2023-02-12 23:53:15 -05:00
#ifndef PAIR_H /* <!-- guard */
#define PAIR_H
2023-02-03 14:50:10 -05:00
#include <stdint.h>
struct pair { const char *a, *b; };
struct pair pair(const char *const a, const char *const b);
int pair_to_natural(const char *, const char *, uint32_t *);
2023-02-14 18:07:42 -05:00
int pair_colon_to_minutes(const char *, const char *,
const char *, const char *, uint32_t *);
int pair_hours_to_minutes(const char *h0, const char *const h1,
const char *m0, const char *const m1, uint32_t *const n);
int pair_is_equal(struct pair, struct pair);
2023-02-04 22:06:43 -05:00
int pair_is_string(struct pair, const char *);
2023-03-31 21:54:45 -04:00
/*fixme*/
uint32_t pair_djb2(const struct pair p);
2023-02-12 23:53:15 -05:00
2023-03-31 21:54:45 -04:00
/* Supporting pair -> size_t for looking up in arrays. */
#define TABLE_NAME pairmap
#define TABLE_KEY struct pair
#define TABLE_UINT uint32_t
#define TABLE_VALUE size_t
#define TABLE_HEAD
#include "../src/table.h"
2023-02-12 23:53:15 -05:00
#endif /* guard --> */