--- embedaddon/confuse/doc/tutorial-html/ar01s06.html 2017/01/24 14:48:55 1.1.1.1 +++ embedaddon/confuse/doc/tutorial-html/ar01s06.html 2021/03/17 00:49:17 1.1.1.2 @@ -1,8 +1,7 @@ - - -6. Validating callback functions

6. Validating callback functions

+ +6. Validating callback functions

6. Validating callback functions

Remember the problem about a negative or too large "repeat" value - in Section 2, “Other types of options”? The code that prints + in Section 2, “Other types of options”? The code that prints the greeting has those lines:

 ...
@@ -54,7 +53,7 @@ typedef int (*cfg_validate_callback_t)(cfg_t *cfg, cfg
             cfg_opt_getint(opt) to retrieve the only
             value. However, if we later want to use this callback to validate
             an integer list, it is already lists-aware.
-        

6.1. Installing the callback

+

6.1. Installing the callback

The validating callback is installed with cfg_set_validate_func(). It is called with a string specifying which option is affected, and a pointer to @@ -121,4 +120,4 @@ typedef int (*cfg_validate_callback_t)(cfg_t *cfg, cfg 53 return 0; 54 } 55 -

+ \ No newline at end of file