Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

hook_config_section(3alleg4) [debian man page]

hook_config_section(3alleg4)					  Allegro manual				      hook_config_section(3alleg4)

NAME
hook_config_section - Hooks a configuration file section with custom handlers. Allegro game programming library. SYNOPSIS
#include <allegro.h> void hook_config_section(const char *section, int (*intgetter)(const char *name, int def), const char *(*stringgetter)(const char *name, const char *def), void (*stringsetter)(const char *name, const char *value)); 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() SEE ALSO
config_is_hooked(3alleg4) Allegro version 4.4.2 hook_config_section(3alleg4)

Check Out this Related Man Page

get_config_string(3alleg4)					  Allegro manual					get_config_string(3alleg4)

NAME
get_config_string - Retrieves a string from the configuration file. Allegro game programming library. SYNOPSIS
#include <allegro.h> const char *get_config_string(const char *section, const char *name, const char *def); DESCRIPTION
Retrieves a string variable from the current config file. The section name may be set to NULL to read variables from the root of the file, or used to control which set of parameters (eg. sound or joystick) you are interested in reading. Example: const char *lang = get_config_string("system", "language", "EN"); RETURN VALUE
Returns a pointer to the constant string found in the configuration file. If the named variable cannot be found, or its entry in the con- fig file is empty, the value of `def' is returned. SEE ALSO
set_config_file(3alleg4), set_config_string(3alleg4), get_config_argv(3alleg4), get_config_float(3alleg4), get_config_hex(3alleg4), get_config_int(3alleg4), get_config_id(3alleg4), get_config_text(3alleg4), exconfig(3alleg4) Allegro version 4.4.2 get_config_string(3alleg4)
Man Page

9 More Discussions You Might Find Interesting

1. Programming

File declare !

Dear all I declare like this in my program : int main(int argc ,char **argv) { FILE *ft; char* ini_file; char fbuf; char sendbuf; char strbuf; } When I compile this is the error : cc: "send.c", line 28: error 1588: "ft" undefined. (1 Reply)
Discussion started by: iwbasts
1 Replies

2. Programming

string returning function

I have two string returning function in ESQL/C char *segment_name(lbuffer) char *lbuffer; {..... and char *get_bpdvalue(f_name) char *f_name; {...... both declared above main() char *get_bpdvalue(); char *segment_name(); my problem is segment_name works on sprintf and strcpy... (5 Replies)
Discussion started by: jisc
5 Replies

3. Programming

char *p and char p[].

Can anyone please explain me the difference between char *p and char p ? Thanks in Advance, Arun. (4 Replies)
Discussion started by: arunviswanath
4 Replies

4. Shell Programming and Scripting

.def file in HP-UX Shell scripting

Hi Pals, I need some information related .def file in HP-Ux shell scripting. What actaully a .def file contains. It is having all definitions of some functions. But what is the relationship between a .def file and shell script. Can anyone give some examples. Thanks in Advance. Best... (1 Reply)
Discussion started by: manu.vmr
1 Replies

5. Programming

How to get the sizeof char pointer

The below code throws the error, since the size of x = 19 is not passed to the cstrCopy function. using namespace std; static void cstrCopy(char *x, const char*y); int main () { char x; const string y = "UNIX FORUM"; cstrCopy(x,y.c_str()); return 0; } void cstrCopy(char *x,... (3 Replies)
Discussion started by: SamRoj
3 Replies

6. Shell Programming and Scripting

Make multiple awk files into an executable

Hello everyone, The following are my input files. The following are my sequence of steps. Can someone please let me know about how to make these bunch of steps into a single script so that I start the script with 1.txt and 2.txt, after execution gives me the final... (11 Replies)
Discussion started by: jacobs.smith
11 Replies

7. Homework & Coursework Questions

KLIBC .def file

I am working on klibc. I need to add a new command in kernel. klibc contains a SYSCALLS.def file which declares functions. Where can I find definition of functions declared in .def file? (1 Reply)
Discussion started by: Vasundhara08
1 Replies

8. UNIX for Beginners Questions & Answers

Appending time stamp for multiple file

Hi All, I am trying to append time stamp to all file with wild character. If you look above I want take all file with wild card *001* and append current time stamp to it. I did below code. But not sure if there is any easy way that can be done in a single step a=date +%s for... (3 Replies)
Discussion started by: arunkumar_mca
3 Replies

9. UNIX for Beginners Questions & Answers

Remove lines ending with a certain character

I have a file of a content like this: abc_bla -def 800 abc_bla -def 802 abc_bla -def 804 abc_bla -def 806 abc_bla -def 808 abc_bla -def 810 abc_bla -def 812 abc_bla -def 814 ... abc_bla -def 898 abc_bla -def 900 abc_bla -def 902 abc_bla -def 904 ... abc_bla -def 990 abc_bla -def... (7 Replies)
Discussion started by: maya3
7 Replies