shtk_config_run_hook man page on DragonFly

Man page or keyword search:  
man Server   44335 pages
apropos Keyword Search (all sections)
Output format
DragonFly logo
[printable version]

SHTK_CONFIG_RUN_HOOK(3)	 BSD Library Functions Manual  SHTK_CONFIG_RUN_HOOK(3)

NAME
     shtk_config_run_hook — Executes a hook defined in a configuration file

LIBRARY
     shtk_import config

SYNOPSIS
     shtk_config_run_hook hook [arg1 .. argN]

DESCRIPTION
     The shtk_config_run_hook function executes the function hook, defined by
     the configuration file, in the same context as the file.  Any arguments
     arg1 to argN are passed literally to the hook.  Hooks should not be exe‐
     cuted directly because otherwise they would need to use the
     shtk_config_get(3) familiy of functions to read the variables defined in
     the file, which could be quite strange.

     Keep in mind that the hook will only be able to access the configuration
     variables previously registered with shtk_config_init(3).	Any other
     variables will be hidden and not available to the hook.

EXAMPLES
     Consider the following configuration file:

	   SRCDIR=/usr/src

	   show_srcdir_hook() {
	       # Note that we can access SRCDIR directly, as would be normal in a
	       # configuration file.  No need to use shtk_config_get.
	       echo "SRCDIR is ${SRCDIR}"
	   }

     Then, we could process the file and execute the defined hook like this:

	   shtk_config_init SRCDIR
	   shtk_config_load ".../path/to/the/file/above.conf"

	   # This will print nothing because SRCDIR is not available here.
	   echo "SRCDIR is ${SRCDIR}"

	   # But this will display the right SRCDIR value.
	   shtk_config_run_hook show_srcdir_hook

ERRORS
     Errors during the execution of the hook result in the termination of the
     script.

SEE ALSO
     shtk(3), shtk_config(3)

HISTORY
     shtk_config_run_hook first appeared in shtk 1.1.

BSD			       November 6, 2014				   BSD
[top]

List of man pages available for DragonFly

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net