[MPlayer-G2-dev] CVS: g2/DOCS cfg.txt,1.1.1.1,1.2
Attila Kinali CVS
syncmail at mplayerhq.hu
Sun Feb 1 01:04:53 CET 2004
CVS change done by Attila Kinali CVS
Update of /cvsroot/mplayer/g2/DOCS
In directory mail:/var2/tmp/cvs-serv14051
Modified Files:
cfg.txt
Log Message:
fix the dynamic bug ;)
partial update
Index: cfg.txt
===================================================================
RCS file: /cvsroot/mplayer/g2/DOCS/cfg.txt,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- cfg.txt 31 Jan 2004 20:16:18 -0000 1.1.1.1
+++ cfg.txt 1 Feb 2004 00:04:50 -0000 1.2
@@ -16,6 +16,7 @@
char *maintainer;
char *author;
char *comment;
+ unsigned int flags; // low 16 bits: generic flags high 16: type dependent
config_t *config;
config_data_t *config_defaults;
int config_size;
@@ -31,9 +32,9 @@
config_data_t *config_defaults;
int config_size;
-In g2, modules may have their own dinamically allocated config data structure.
+In g2, modules may have their own dynamically allocated config data structure.
It means: no more globals! yeah. Of course globals can be used, too.
-The implementation of per-module dinamic config is the following:
+The implementation of per-module dynamic config is the following:
A module (be it core layer or a plugin) will define its own config_data_t
structure, containing its configuration variables. It can (optinally)
define a set of default values, in the layout of config_data_t.
@@ -67,17 +68,18 @@
"A'rpi",
"Michael Niedermayer",
"uses libswscale.a",
+ 0,
config_format, &config_defaults, sizeof(struct config_data_s)
};
What if I leave/ignore some of these fields?
-- if config_size>0 then config_data will be dinamically allocated,
+- if config_size>0 then config_data will be dynamically allocated,
otherwise all options (in config_t array) are handled as globals,
with absolute pointers.
- if config_defaults!=NULL, then config_data will be cloned from it,
instead of allocating zero-filled memory.
option pointers targetting inside the config_defaults struct will be
- handled as dinamic variables (relocated to cloned config_data), others
+ handled as dynamic variables (relocated to cloned config_data), others
will be handled as globals.
- if config_defaults==NULL and config_size>0, then pointers will be handled
as struct offsets relative to the start of config_data_s structure.
More information about the MPlayer-G2-dev
mailing list