size_t timezone_to_string (const char *name, const char *uri, char *buf, size_t bsize) { if (get_tz (buf, bsize) == NULL) { *buf = '\0'; } return strlen (buf); }
int main(int argc, char **argv) { ad_connect_am(); get_powerzone_collection(0); get_powerzone(0); get_psu_collection(0); get_psu(0, 0); get_thermalzone_collection(); get_tz(0); get_fan_collection(0); get_fan(0, 0); get_drawer_collection(); get_drawer(0); return 0; }
void get_global_opts() { const char * v; uint32 temp; v = gtkopts_getvalue("sound"); if (stricmp(v,"on")==0) {sound=1;}; v = gtkopts_getvalue("fastsound"); if (stricmp(v,"true")==0) {fastsound=1;}; v = gtkopts_getvalue("samplerate"); sound_rate=atoi(v); v = gtkopts_getvalue("llsfilter"); if (stricmp(v,"on")==0) {llsfilter=1;} else { llsfilter=0; }; v = gtkopts_getvalue("rotateright"); if (stricmp(v,"true")==0) {rotateright=1;}; v = gtkopts_getvalue("sound_sem"); if (stricmp(v,"true")==0) {use_sem=1;}; v = gtkopts_getvalue("show_keys"); if (stricmp(v,"true")==0) {show_keys=1;} else { show_keys=0; }; v = gtkopts_getvalue("landscape"); if (stricmp(v,"true")==0) {landscape=1;} else { landscape=0; }; v = gtkopts_getvalue("crop_screen"); crop_screen=2; //auto if (stricmp(v,"true")==0) {crop_screen=1;}; if (stricmp(v,"false")==0) {crop_screen=0;}; v = gtkopts_getvalue("z80"); if (stricmp(v,"off")==0) {use_z80=0;}; if (stricmp(v,"on")==0) {use_z80=1;}; v = gtkopts_getvalue("frameskip"); if (stricmp(v,"auto")==0) { autofs=1; frameskip=0; } else { get_num_val("frameskip",&frameskip); autofs=0; } v = gtkopts_getvalue("savefolder"); sdir=2; //User-defined by default if (stricmp(v,"romfolder")==0) {sdir=0;}; if (stricmp(v,"appfolder")==0) {sdir=1;}; v = gtkopts_getvalue("configfolder"); cdir=2; //User-defined by default if (stricmp(v,"romfolder")==0) {cdir=0;}; if (stricmp(v,"appfolder")==0) {cdir=1;}; v = gtkopts_getvalue("country"); country = 0; //autodetect if (stricmp(v,"u")==0) country=4; if (stricmp(v,"j")==0) country=1; if (stricmp(v,"e")==0) country=8; v = gtkopts_getvalue("sixbuttonpad"); if (stricmp(v,"true")==0) {sixbuttonpad=1;} else { sixbuttonpad=0; }; get_num_val("key_switch",&key_switch); get_num_val("key_start",&key_start); get_num_val("key_up",&key_up); get_num_val("key_down",&key_down); get_num_val("key_left",&key_left); get_num_val("key_right",&key_right); get_num_val("key_up_left",&key_up_left); get_num_val("key_up_right",&key_up_right); get_num_val("key_down_right",&key_down_right); get_num_val("key_down_left",&key_down_left); get_num_val("key_a",&key_a); get_num_val("key_b",&key_b); get_num_val("key_c",&key_c); get_num_val("key_x",&key_x); get_num_val("key_y",&key_y); get_num_val("key_z",&key_z); get_num_val("key_mode",&key_mode); get_num_val("tapzones",&temp); if (temp==6) tmod=2; if (temp==9) tmod=3; get_tz("tapzone_1",&tzones[0]); get_tz("tapzone_2",&tzones[1]); get_tz("tapzone_3",&tzones[2]); get_tz("tapzone_4",&tzones[3]); get_tz("tapzone_5",&tzones[4]); get_tz("tapzone_6",&tzones[5]); get_tz("tapzone_7",&tzones[6]); get_tz("tapzone_8",&tzones[7]); get_tz("tapzone_9",&tzones[8]); }