NESe (pronounced "Nessie") is a NES emulator based on the e6502 emulator, also written in C with a focus on speed and portability for use on embedded platforms, especially ARM.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
822B

  1. #ifndef NESE_INI_H_
  2. #define NESE_INI_H_
  3. typedef enum {
  4. ini_invalid = -1,
  5. ini_none = 0,
  6. ini_comment,
  7. ini_section,
  8. ini_string,
  9. ini_integer,
  10. ini_flag,
  11. } ini_data_type;
  12. typedef struct ini_datum {
  13. ini_data_type type;
  14. int offset; // offset into associated struct
  15. char* name; // key, section, or comment
  16. union {
  17. char* string; // string, comment
  18. struct {
  19. int32_t value; // int, flag
  20. uint32_t shift; // flag
  21. };
  22. struct {
  23. int count;
  24. struct ini_datum* data; // section
  25. };
  26. };
  27. } ini_datum;
  28. int write_ini_file(FILE* file, const ini_datum* schema,
  29. const void* data);
  30. int read_ini_file(FILE* file, const ini_datum* schema,
  31. void* data);
  32. #endif // NESE_INI_H_