Changeset eb2e4add4f3ed2f94fbb2ac3c81b67a8322a85c1
- Timestamp:
- 12/16/07 11:28:24
(9 months ago)
- Author:
- Rémi Denis-Courmont <rem@videolan.org>
- git-committer:
- Rémi Denis-Courmont <rem@videolan.org> 1197800904 +0000
- git-parent:
[a24e0766f7e5a78edf5ddc534cb6cd0005d8cbd9]
- git-author:
- Rémi Denis-Courmont <rem@videolan.org> 1197800904 +0000
- Message:
Some more vlc_config_* code
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r721e7de |
reb2e4ad |
|
| 248 | 248 | |
|---|
| 249 | 249 | |
|---|
| | 250 | VLC_EXPORT( module_config_t *, vlc_config_create, (module_t *, int type) ); |
|---|
| 250 | 251 | VLC_EXPORT( int, vlc_config_set, (module_config_t *, vlc_config_t, ...) ); |
|---|
| 251 | 252 | |
|---|
| … | … | |
| 368 | 369 | #define add_bool( name, v, p_callback, text, longtext, advc ) \ |
|---|
| 369 | 370 | add_typename_inner( CONFIG_ITEM_BOOL, name, text, longtext, advc, p_callback ); \ |
|---|
| 370 | | p_config[i_config].value.i = v |
|---|
| | 371 | if (v) vlc_config_set (p_config + i_config, VLC_CONFIG_VALUE, (int)VLC_TRUE) |
|---|
| 371 | 372 | |
|---|
| 372 | 373 | /* For renamed option */ |
|---|
| r0ed17f9 |
reb2e4ad |
|
| 143 | 143 | } |
|---|
| 144 | 144 | |
|---|
| | 145 | module_config_t *vlc_config_create (module_t *module, int type) |
|---|
| | 146 | { |
|---|
| | 147 | unsigned confsize = module->confsize; |
|---|
| | 148 | module_config_t *tab = module->p_config; |
|---|
| | 149 | |
|---|
| | 150 | if ((confsize & 0xf) == 0) |
|---|
| | 151 | { |
|---|
| | 152 | tab = realloc (tab, (confsize + 17) * sizeof (*tab)); |
|---|
| | 153 | if (tab == NULL) |
|---|
| | 154 | return NULL; |
|---|
| | 155 | |
|---|
| | 156 | module->p_config = tab; |
|---|
| | 157 | } |
|---|
| | 158 | module->confsize++; |
|---|
| | 159 | |
|---|
| | 160 | memset (tab + confsize, 0, sizeof (tab[confsize])); |
|---|
| | 161 | return tab + confsize; |
|---|
| | 162 | } |
|---|
| | 163 | |
|---|
| 145 | 164 | int vlc_config_set (module_config_t *restrict item, vlc_config_t id, ...) |
|---|
| 146 | 165 | { |
|---|