mirror of
https://github.com/ApfelTeeSaft/vanilla.git
synced 2026-08-26 19:33:44 +00:00
* microphone initial work * implement dumping functionality Allows us to dump packets from the console for replay later on * implement dump playback functionality * pipe: when using playback, don't require wireless adapter * move dump functionality to pipe * started caramel library for interfacing with real gamepad * finalized microphone implementation * cleanup * cleanup 2 * cleanup 3 * cleanup 4 * fixed more issues * use initializers so mutex and cond are always valid * rewrite audio output system to improve latency * fix indent * provide capability for audio to be enabled/disabled based on state * fix android builds
29 lines
775 B
C
29 lines
775 B
C
#ifndef VANILLA_UTIL_H
|
|
#define VANILLA_UTIL_H
|
|
|
|
#include <stddef.h>
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
|
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
|
#define MAX(a,b) (((a)>(b))?(a):(b))
|
|
#define CLAMP(x, min, max) (MIN(MAX(x, min), max))
|
|
|
|
size_t read_line_from_fd(int fd, char *output, size_t max_output_size);
|
|
size_t read_line_from_file(FILE *file, char *output, size_t max_output_size);
|
|
size_t get_max_path_length();
|
|
|
|
void clear_interrupt();
|
|
int is_interrupted();
|
|
void force_interrupt();
|
|
void install_interrupt_handler();
|
|
void uninstall_interrupt_handler();
|
|
size_t get_millis();
|
|
unsigned int reverse_bits(unsigned int b, int bit_count);
|
|
|
|
uint16_t crc16(const void* data, size_t len);
|
|
|
|
void print_hex(const void *data, size_t len);
|
|
|
|
#endif // VANILLA_UTIL_H
|