GrafX2 2.9.3227
The ultimate 256-color painting program
|
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "const.h"
#include "global.h"
#include "readini.h"
#include "io.h"
#include "errors.h"
#include "misc.h"
#include "saveini.h"
#include "setup.h"
#include "windows.h"
Functions | |
static int | Save_INI_reach_group (FILE *old_file, FILE *new_file, char *buffer, const char *group) |
go forward in gfx2.ini until the group is found More... | |
static int | Save_INI_char_in_value_alphabet (char c) |
Check if a character is [-$.0-9A-Z] which are the allowed characters for values. More... | |
static void | Save_INI_set_value (char *dest, const char *source, int nb_values_to_set, const int *values, int litteral) |
build a gfx2.ini line More... | |
static void | Save_INI_set_string (char *dest, const char *source, const char *value) |
build a gfx2.ini line More... | |
static int | Save_INI_set_strings (FILE *old_file, FILE *new_file, char *buffer, const char *option_name, const char *value) |
Set an option value in gfx2.ini. More... | |
static int | Save_INI_set_values (FILE *old_file, FILE *new_file, char *buffer, const char *option_name, int nb_values_to_set, const int *values, int litteral) |
set option values in the gfx2.ini file More... | |
static void | Save_INI_flush (FILE *old_file, FILE *new_file, char *buffer) |
copy all remaining lines More... | |
int | Save_INI (const T_Config *conf) |
Save the config to the gfx2.ini file. More... | |
|
static |
go forward in gfx2.ini until the group is found
References ERROR_INI_CORRUPTED, ERROR_SAVING_INI, Load_INI_clear_string(), and Load_INI_seek_pattern().
Referenced by Save_INI().
|
static |
Check if a character is [-$.0-9A-Z] which are the allowed characters for values.
Referenced by Save_INI_set_string(), and Save_INI_set_value().
|
static |
build a gfx2.ini line
[out] | dest | the destination buffer |
source | the original gfx2.ini line | |
nb_values_to_set | the number of values to set | |
values | the array of values | |
litteral | if true, the value name is written, else the digital value |
References Save_INI_char_in_value_alphabet().
Referenced by Save_INI_set_values().
|
static |
build a gfx2.ini line
[out] | dest | receiving buffer for the line |
source | original gfx2.ini line | |
value | value to write |
References NULL, and Save_INI_char_in_value_alphabet().
Referenced by Save_INI_set_strings().
|
static |
Set an option value in gfx2.ini.
References ERROR_INI_CORRUPTED, ERROR_SAVING_INI, Load_INI_clear_string(), Load_INI_seek_pattern(), NULL, and Save_INI_set_string().
Referenced by Save_INI().
|
static |
set option values in the gfx2.ini file
References ERROR_INI_CORRUPTED, ERROR_SAVING_INI, GFX2_Log(), GFX2_WARNING, Load_INI_clear_string(), Load_INI_seek_pattern(), and Save_INI_set_value().
Referenced by Save_INI().
|
static |
int Save_INI | ( | const T_Config * | conf | ) |
Save the config to the gfx2.ini file.
References T_Config::Adjust_brush_pick, T_Config::Allow_multi_shortcuts, T_Config::Auto_discontinuous, T_Config::Auto_nb_used, T_Config::Auto_save, T_Config::Auto_set_res, T_Components::B, T_Config::Backup, T_Config::Bookmark_directory, T_Config::Bookmark_label, T_Config::Clear_palette, T_Config::Clear_with_stencil, Config_directory, T_Config::Coords_rel, T_Config::Cursor, Data_directory, DEBUG, T_Config::Default_mode_layers, T_Config::Default_resolution, Default_window_height, Default_window_width, T_Config::Delay_left_click_on_slider, T_Config::Delay_right_click_on_slider, T_Config::Display_image_limits, T_Config::Double_click_speed, T_Config::Double_key_speed, ERROR_INI_MISSING, ERROR_SAVING_INI, T_Config::Fast_zoom, T_Config::Fav_menu_colors, File_exists(), Filepath_append_to_dir(), T_Config::Find_file_fast, T_Config::Font_file, T_Config::FX_Feedback, T_Components::G, GFX2_DEBUG, GFX2_Log(), GFX2_MOD_ALT, GFX2_MOD_CTRL, T_Video_mode::Height, INI_FILENAME, INIDEF_FILENAME, INISAVE_FILENAME, T_Config::Max_undo_pages, T_Config::Maximize_preview, Menu_bars, MENUBAR_ANIMATION, MENUBAR_LAYERS, MENUBAR_TOOLS, Mode_label(), T_Config::MOTO_gamma, T_Config::Mouse_merge_movement, T_Config::Mouse_motion_debounce, T_Config::Mouse_sensitivity_index_x, T_Config::Mouse_sensitivity_index_y, NB_BOOKMARKS, T_Config::Nb_max_vertices_per_polygon, NULL, T_Config::Opening_message, T_Config::Palette_cells_X, T_Config::Palette_cells_Y, T_Config::Palette_vertical, Pixel_ratio, T_Components::R, T_Config::Ratio, T_Config::Right_click_colorpick, T_Config::Safety_colors, Save_INI_flush(), Save_INI_reach_group(), Save_INI_set_strings(), Save_INI_set_values(), T_Config::Screen_size_in_GIF, T_Config::Scripts_directory, T_Config::Separate_colors, T_Config::Set_resolution_according_to, T_Config::Show_hidden_directories, T_Config::Show_hidden_files, T_Config::Skin_file, T_Config::Swap_buttons, T_Config::Sync_views, T_Config::Tilemap_allow_flipped_x, T_Config::Tilemap_allow_flipped_y, T_Config::Tilemap_show_count, T_Config::Timer_delay, T_Config::Use_virtual_keyboard, Video_mode, T_Video_mode::Width, T_Config::Window_pos_x, and T_Config::Window_pos_y.
Referenced by Program_shutdown(), and Settings_save_config().