summaryrefslogtreecommitdiff
path: root/lib/hitomezashi_utils.h
blob: 95a5a3f6d6887ed091b006dcf4ec4d356a463505 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/** @file
 * Utilities connected with hitomezashi patterns that may be useful to
 * applications.
 */
#ifndef HITOMEZASHI_UTILS_H
#define HITOMEZASHI_UTILS_H

#include <stddef.h>

/** Convert a string of ASCII digit 0s and 1s, eg. "1010", to a char array of
 * numeric 0s and 1s. The return value is **dynamically allocated and must
 * be freed**.
 * @param len Length of ascii_str, not including any terminating null bytes.
 */
char *hitomezashi_ascii_binary_str_to_ints(const char *ascii_str, size_t len);

#endif // HITOMEZASHI_UTILS_H