comparison m_option.h @ 25229:4f611a555224

Option print functions may not and do not modify value
author reimar
date Sun, 02 Dec 2007 15:56:38 +0000
parents cc170348a763
children 4129c8cfa742
comparison
equal deleted inserted replaced
25228:475c6659f31c 25229:4f611a555224
202 /** \param opt The option to print. 202 /** \param opt The option to print.
203 * \param val Pointer to the memory holding the data to be printed. 203 * \param val Pointer to the memory holding the data to be printed.
204 * \return An allocated string containing the text value or (void*)-1 204 * \return An allocated string containing the text value or (void*)-1
205 * on error. 205 * on error.
206 */ 206 */
207 char* (*print)(const m_option_t* opt, void* val); 207 char* (*print)(const m_option_t* opt, const void* val);
208 208
209 /** \name 209 /** \name
210 * These functions are called to save/set/restore the status of the 210 * These functions are called to save/set/restore the status of the
211 * variables. The difference between the 3 only matters for types like 211 * variables. The difference between the 3 only matters for types like
212 * \ref m_option_type_func where 'setting' needs to do more than just 212 * \ref m_option_type_func where 'setting' needs to do more than just
459 return opt->type->parse(opt,name,param,dst,src); 459 return opt->type->parse(opt,name,param,dst,src);
460 } 460 }
461 461
462 /// Helper to print options, see \ref m_option_type::print. 462 /// Helper to print options, see \ref m_option_type::print.
463 inline static char* 463 inline static char*
464 m_option_print(const m_option_t* opt, void* val_ptr) { 464 m_option_print(const m_option_t* opt, const void* val_ptr) {
465 if(opt->type->print) 465 if(opt->type->print)
466 return opt->type->print(opt,val_ptr); 466 return opt->type->print(opt,val_ptr);
467 else 467 else
468 return (char*)-1; 468 return (char*)-1;
469 } 469 }