logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

hook_config_section - Hooks a configuration file section with custom handlers. Allegro game programming

Description

       Takes control of the specified config file  section,  so  that  your  hook  functions  will  be  used  to
       manipulate it instead of the normal disk file access. If both the getter and setter functions are NULL, a
       currently  present  hook  will  be  unhooked. Hooked functions have the highest priority. If a section is
       hooked, the hook will always be called, so you can also hook a '#' section:  even  override_config_file()
       cannot override a hooked section. Example:

          int decode_encrypted_int(const char *name, int def)
          {
             ...
          }

          const char *decode_encrypted_string(const char *name, const char *def)
          {
             ...
          }

          void encode_plaintext_string(const char *name, const char *value)
          {
             ...
          }

          int main(int argc, char *argv[])
          {
             ...
             /* Make it harder for users to tinker with the high scores. */
             hook_config_section("high_scores", decode_encrypted_int,
                decode_encrypted_string, encode_plaintext_string);
             ...
          } END_OF_MAIN()

Name

       hook_config_section  -  Hooks a configuration file section with custom handlers. Allegro game programming
       library.

See Also

config_is_hooked(3alleg4)

Allegro                                           version 4.4.3                     hook_config_section(3alleg4)

Synopsis

#include<allegro.h>voidhook_config_section(constchar*section,int(*intgetter)(constchar*name,intdef),constchar*(*stringgetter)(constchar*name,constchar*def),void(*stringsetter)(constchar*name,constchar*value));

See Also