aoc/include/advent_utility.h

28 lines
663 B
C
Raw Normal View History

#ifndef ADVENT_H_UTILITY_
#define ADVENT_H_UTILITY_
2023-11-30 12:51:32 -08:00
#include "lfvector.h"
#define DEFAULT_DELIM " \t\n\r\f\v"
2023-12-05 21:59:01 -08:00
#define MAX(x, y) (x) > (y) ? (x) : (y)
#define MIN(x, y) (x) < (y) ? (x) : (y)
2021-09-18 10:59:09 -07:00
char *md5_str(const char *);
2023-11-30 12:51:32 -08:00
Vector *string_to_int_vector(const char *input_string, const char *delim);
2024-12-02 07:17:41 -08:00
int int_comp(const void *a, const void *b);
2024-12-03 12:08:18 -08:00
char **get_matches(char *in, char *pat, size_t *sz, size_t max_matches);
void free_matches(char **matches, size_t sz);
2024-12-09 19:12:05 -08:00
enum Direction {
DIR_NORTH = 0,
DIR_EAST = 1,
DIR_SOUTH = 2,
DIR_WEST = 3,
};
void turn_right(enum Direction *d);
void turn_left(enum Direction *d);
#endif