[sr-dev] git:master: cfg framework: readme correction

Miklos Tirpak miklos at iptel.org
Mon Jul 13 16:59:43 CEST 2009


Module: sip-router
Branch: master
Commit: f38774811308f3e33984fd1e7d1375f00202572f
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=f38774811308f3e33984fd1e7d1375f00202572f

Author: Miklos Tirpak <miklos at iptel.org>
Committer: Miklos Tirpak <miklos at iptel.org>
Date:   Mon Jul 13 16:58:22 2009 +0200

cfg framework: readme correction

Documentation about how to read "foreign" config values is
corrected.

---

 doc/cfg.txt |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/doc/cfg.txt b/doc/cfg.txt
index 93d2c77..548ef5d 100644
--- a/doc/cfg.txt
+++ b/doc/cfg.txt
@@ -169,13 +169,15 @@ cfg_get(foo, cfg_handle, p)
 It is also possible to access the variables of other modules or the core in two
 different ways:
 
-1) Include the header file of the other module/core that declares the cfg_group_*
-structure and the handle for it. Than use the handle of that module/core to access
+1) For the core: include the header file that declares the cfg_group_*
+structure and the handle for it. Than use the handle of the core to access
 the variable:
 
-cfg_get(bar, cfg_handle_of_bar, j);
+#include "../../cfg_core.h"
+cfg_get(core, core_cfg, use_dst_blacklist)
 
-2) Access the variables by their group and variable name:
+2) For the core, module, or script: access the variables by their group
+and variable name:
 
 #include "../../cfg/cfg_select.h"
 
@@ -195,15 +197,15 @@ static int mod_init(void)
 }
 
 int	j;
-if ((cfg_read_var_int(&var_bar_j, &j)) < 0) { error... }
+if ((read_cfg_var_int(&var_bar_j, &j)) < 0) { error... }
 
 or similarly,
 str	s;
-if ((cfg_read_var_str(&var_bar_j, &s)) < 0) { error... }
+if ((read_cfg_var_str(&var_bar_j, &s)) < 0) { error... }
 
 2) is a bit slower than 1) because the first solution returns the pointer directly
-to the variable, but 2) supports also the variables declared in the script that are
-not known at compile time.
+to the variable, but 2) offers access also to the configuration of other modules
+and to the variables declared in the script that are not known at compile time.
 
 3. Using the framework in the core
 ===============================================================================




More information about the sr-dev mailing list