Add-in development tools for fx-9860G and fx-CG 50, to use with GCC and gint.
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.
 
 
 
 
 
 

42 lines
1009 B

#include "properties.h"
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
bool properties_match(properties_t const *props, properties_t const *option)
{
if(option->p7 && !props->p7)
return false;
if(option->mass_storage && !props->mass_storage)
return false;
if(option->series_cg && !props->series_cg)
return false;
if(option->series_g3 && !props->series_g3)
return false;
if(option->serial_number && (!props->serial_number ||
strcmp(option->serial_number, props->serial_number)))
return false;
return true;
}
void properties_print(FILE *fp, properties_t const *props)
{
#define output(...) { \
if(sep) fprintf(fp, ", "); \
fprintf(fp, __VA_ARGS__); \
sep = true; \
}
bool sep = false;
if(props->p7)
output("p7");
if(props->mass_storage)
output("mass_storage");
if(props->series_cg)
output("series_cg");
if(props->series_g3)
output("series_g3");
if(props->serial_number)
output("serial_number=%s", props->serial_number);
}