2014-09-24 17:40:21 -04:00
|
|
|
/*
|
|
|
|
* Utility functions shared by all the demo programs.
|
|
|
|
*/
|
2015-05-27 10:10:07 -04:00
|
|
|
#ifndef UTILS_H
|
|
|
|
#define UTILS_H
|
2014-09-24 17:40:21 -04:00
|
|
|
|
2015-05-27 09:40:37 -04:00
|
|
|
#include <stddef.h>
|
2014-09-24 17:40:21 -04:00
|
|
|
|
2015-05-27 09:40:37 -04:00
|
|
|
#define MAX_INPUT_SIZE 4096 /* max size of all input buffers in the demo */
|
2014-09-24 17:40:21 -04:00
|
|
|
|
2015-05-27 09:27:15 -04:00
|
|
|
void print_hex(const void *bin, const size_t bin_len);
|
2015-05-27 10:10:07 -04:00
|
|
|
|
2015-05-27 09:27:15 -04:00
|
|
|
size_t prompt_input(char *prompt, char *input, const size_t max_input_len);
|
2015-05-27 10:10:07 -04:00
|
|
|
|
2014-09-24 17:40:21 -04:00
|
|
|
void print_verification(int r);
|
|
|
|
|
2015-05-27 10:10:07 -04:00
|
|
|
void init(void);
|
|
|
|
|
|
|
|
#endif /* UTILS_H */
|