Human68k CUI emulator with sound.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tools.h 638B

1234567891011121314151617181920
  1. #ifndef TOOLS_H_
  2. #define TOOLS_H_
  3. #include <stdlib.h>
  4. #include <stdint.h>
  5. #define MIN(a, b) ((a) < (b) ? (a) : (b))
  6. #define MAX(a, b) ((a) > (b) ? (a) : (b))
  7. uint8_t *load_file(const char *filename, size_t *size_out);
  8. uint8_t *load_gzfile(const char *filename, size_t *size_out);
  9. int gcd(int a, int b); /* Greatest Common Divisor */
  10. void csv_quote(char *str, size_t len);
  11. // Execute fn for every file or for each file in every folder
  12. // if recurse = 1, recurse subdirectories
  13. // names and num_names can come from argv and argc
  14. void each_file(const char **names, int num_names, void (*fn)(char *), int recurse);
  15. #endif /* TOOLS_H_ */