This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
pcb:preferences_subsystem [2020/06/28 19:23] cparker |
pcb:preferences_subsystem [2020/07/26 13:58] cparker |
||
---|---|---|---|
Line 173: | Line 173: | ||
There will be a function for reading a preferences file, and a function for writing a preferences file. | There will be a function for reading a preferences file, and a function for writing a preferences file. | ||
+ | <code c> | ||
void read_pref_file (char * fname) | void read_pref_file (char * fname) | ||
{ | { | ||
Line 179: | Line 179: | ||
/* open the file for reading */ | /* open the file for reading */ | ||
} | } | ||
+ | </code> | ||
+ | <code c> | ||
/* void pref_float (char * index_str, char * input_str, void *ptr) | /* void pref_float (char * index_str, char * input_str, void *ptr) | ||
* This function takes an input string, converts it to a float, and assigns it to ptr. | * This function takes an input string, converts it to a float, and assigns it to ptr. | ||
Line 195: | Line 196: | ||
/* return 0; */ | /* return 0; */ | ||
} | } | ||
+ | </code> | ||
+ | <code c> | ||
/* char * float_pref(index_str, float fval) | /* char * float_pref(index_str, float fval) | ||
* This function takes an input float and converts it to a string for storage in a preferences file. | * This function takes an input float and converts it to a string for storage in a preferences file. | ||
Line 212: | Line 215: | ||
return fstr; | return fstr; | ||
} | } | ||
+ | </code> | ||
Questions: | Questions: |