void blocks_sync(void) { UnicodeBlock *block; profile_write("blocks"); block = unicode_blocks; while (block->name) { profile_sync_short(&block->enabled); block++; } profile_write("\n"); }
void window_sync(void) /* Sync data with profile, do not change item order! */ { profile_write("window"); /* Docking the window will mess up the desired natural frame */ if (!profile_read_only && window_docked) { profile_sync_int(&window_frame_saved.x); profile_sync_int(&window_frame_saved.y); } else { profile_sync_int(&window_frame.x); profile_sync_int(&window_frame.y); } profile_sync_int(&training_block); profile_sync_int(&window_shown); profile_sync_int(&window_button_labels); profile_sync_int(&keyboard_size); profile_sync_int(&window_docked); profile_write("\n"); }
void options_sync(void) /* Read or write options. Order here is important for compatibility. */ { profile_write("options"); profile_sync_int(&cell_width); profile_sync_int(&cell_height); profile_sync_int(&cell_cols_pref); profile_sync_int(&cell_rows_pref); color_sync(&custom_active_color); color_sync(&custom_inactive_color); color_sync(&custom_select_color); color_sync(&custom_ink_color); profile_sync_int(&train_on_input); profile_sync_int(&ignore_stroke_dir); profile_sync_int(&ignore_stroke_num); profile_sync_int(&wordfreq_enable); profile_sync_int(&right_to_left); color_sync(&custom_key_color); profile_sync_int(&keyboard_enabled); profile_sync_int(&xinput_enabled); profile_sync_int(&style_colors); profile_sync_int(&status_menu_left_click); profile_write("\n"); }
int vfprintf(FILE *stream, const char *format, va_list ap) { static char buf[4096]; if((stream == stdin) || (stream == stdout) || (stream == stderr)) { int r = vsnprintf(buf, sizeof(buf), format, ap); runtime_write(r, buf); return r; } #ifdef PROFILING if(stream) { int r = vsnprintf(buf, sizeof(buf), format, ap); profile_write(stream, buf, r); return r; } #endif return -1; }