1 /*****************************************************************************
2 * cache.c: Plugins cache
3 *****************************************************************************
4 * Copyright (C) 2001-2007 the VideoLAN team
7 * Authors: Sam Hocevar <sam@zoy.org>
8 * Ethan C. Baldridge <BaldridgeE@cadmus.com>
9 * Hans-Peter Jansen <hpj@urpla.net>
10 * Gildas Bazin <gbazin@videolan.org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
31 #include <vlc_common.h>
34 #include <stdlib.h> /* free(), strtol() */
35 #include <stdio.h> /* sprintf() */
36 #include <string.h> /* strdup() */
37 #include <vlc_plugin.h>
39 #ifdef HAVE_SYS_TYPES_H
40 # include <sys/types.h>
46 #if !defined(HAVE_DYNAMIC_PLUGINS)
47 /* no support for plugins */
48 #elif defined(HAVE_DL_DYLD)
49 # if defined(HAVE_MACH_O_DYLD_H)
50 # include <mach-o/dyld.h>
52 #elif defined(HAVE_DL_BEOS)
53 # if defined(HAVE_IMAGE_H)
56 #elif defined(HAVE_DL_WINDOWS)
58 #elif defined(HAVE_DL_DLOPEN)
59 # if defined(HAVE_DLFCN_H) /* Linux, BSD, Hurd */
62 # if defined(HAVE_SYS_DL_H)
65 #elif defined(HAVE_DL_SHL_LOAD)
66 # if defined(HAVE_DL_H)
71 #include "config/configuration.h"
73 #include "vlc_charset.h"
75 #include "modules/modules.h"
78 /*****************************************************************************
80 *****************************************************************************/
81 #ifdef HAVE_DYNAMIC_PLUGINS
82 static int CacheLoadConfig ( module_t *, FILE * );
83 static int CacheSaveConfig ( module_t *, FILE * );
84 static char * CacheName ( void );
87 * (only used to avoid breakage in dev version when cache structure changes) */
88 #define CACHE_SUBVERSION_NUM 3
90 /*****************************************************************************
91 * LoadPluginsCache: loads the plugins cache file
92 *****************************************************************************
93 * This function will load the plugin cache if present and valid. This cache
94 * will in turn be queried by AllocateAllPlugins() to see if it needs to
95 * actually load the dynamically loadable module.
96 * This allows us to only fully load plugins when they are actually used.
97 *****************************************************************************/
98 void CacheLoad( vlc_object_t *p_this )
100 char *psz_filename, *psz_cachedir = config_GetCacheDir();
102 int i, j, i_size, i_read;
103 char p_cachestring[sizeof("cache " COPYRIGHT_MESSAGE)];
104 char p_cachelang[6], p_lang[6];
106 module_cache_t **pp_cache = 0;
107 int32_t i_file_size, i_marker;
108 libvlc_global_data_t *p_libvlc_global = vlc_global();
110 if( !psz_cachedir ) /* XXX: this should never happen */
112 msg_Err( p_this, "Unable to get cache directory" );
116 if( asprintf( &psz_filename, "%s"DIR_SEP"%s",
117 psz_cachedir, CacheName() ) == -1 )
119 free( psz_cachedir );
122 free( psz_cachedir );
124 if( p_libvlc_global->p_module_bank->b_cache_delete )
126 #if !defined( UNDER_CE )
127 unlink( psz_filename );
129 wchar_t psz_wf[MAX_PATH];
130 MultiByteToWideChar( CP_ACP, 0, psz_filename, -1, psz_wf, MAX_PATH );
131 DeleteFile( psz_wf );
133 msg_Dbg( p_this, "removing plugins cache file %s", psz_filename );
134 free( psz_filename );
138 msg_Dbg( p_this, "loading plugins cache file %s", psz_filename );
140 file = utf8_fopen( psz_filename, "rb" );
143 msg_Warn( p_this, "could not open plugins cache file %s for reading",
145 free( psz_filename );
148 free( psz_filename );
150 /* Check the file size */
151 i_read = fread( &i_file_size, 1, sizeof(i_file_size), file );
152 if( i_read != sizeof(i_file_size) )
154 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
160 fseek( file, 0, SEEK_END );
161 if( ftell( file ) != i_file_size )
163 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
164 "(corrupted size)" );
168 fseek( file, sizeof(i_file_size), SEEK_SET );
170 /* Check the file is a plugins cache */
171 i_size = sizeof("cache " COPYRIGHT_MESSAGE) - 1;
172 i_read = fread( p_cachestring, 1, i_size, file );
173 if( i_read != i_size ||
174 memcmp( p_cachestring, "cache " COPYRIGHT_MESSAGE, i_size ) )
176 msg_Warn( p_this, "This doesn't look like a valid plugins cache" );
181 #ifdef DISTRO_VERSION
182 /* Check for distribution specific version */
183 char p_distrostring[sizeof( DISTRO_VERSION )];
184 i_size = sizeof( DISTRO_VERSION ) - 1;
185 i_read = fread( p_distrostring, 1, i_size, file );
186 if( i_read != i_size ||
187 memcmp( p_distrostring, DISTRO_VERSION, i_size ) )
189 msg_Warn( p_this, "This doesn't look like a valid plugins cache" );
195 /* Check Sub-version number */
196 i_read = fread( &i_marker, 1, sizeof(i_marker), file );
197 if( i_read != sizeof(i_marker) || i_marker != CACHE_SUBVERSION_NUM )
199 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
200 "(corrupted header)" );
205 /* Check the language hasn't changed */
206 sprintf( p_lang, "%5.5s", _("C") ); i_size = 5;
207 i_read = fread( p_cachelang, 1, i_size, file );
208 if( i_read != i_size || memcmp( p_cachelang, p_lang, i_size ) )
210 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
211 "(language changed)" );
216 /* Check header marker */
217 i_read = fread( &i_marker, 1, sizeof(i_marker), file );
218 if( i_read != sizeof(i_marker) ||
219 i_marker != ftell( file ) - (int)sizeof(i_marker) )
221 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
222 "(corrupted header)" );
227 p_libvlc_global->p_module_bank->i_loaded_cache = 0;
228 if (fread( &i_cache, 1, sizeof(i_cache), file ) != sizeof(i_cache) )
230 msg_Warn( p_this, "This doesn't look like a valid plugins cache "
231 "(file too short)" );
237 pp_cache = p_libvlc_global->p_module_bank->pp_loaded_cache =
238 malloc( i_cache * sizeof(void *) );
240 #define LOAD_IMMEDIATE(a) \
241 if( fread( (void *)&a, sizeof(char), sizeof(a), file ) != sizeof(a) ) goto error
242 #define LOAD_STRING(a) \
245 if( ( fread( &i_size, sizeof(i_size), 1, file ) != 1 ) \
246 || ( i_size > 16384 ) ) \
249 char *psz = malloc( i_size ); \
250 if( fread( psz, i_size, 1, file ) != 1 ) { \
254 if( psz[i_size-1] ) { \
262 for( i = 0; i < i_cache; i++ )
267 pp_cache[i] = malloc( sizeof(module_cache_t) );
268 p_libvlc_global->p_module_bank->i_loaded_cache++;
270 /* Load common info */
271 LOAD_STRING( pp_cache[i]->psz_file );
272 LOAD_IMMEDIATE( pp_cache[i]->i_time );
273 LOAD_IMMEDIATE( pp_cache[i]->i_size );
274 LOAD_IMMEDIATE( pp_cache[i]->b_junk );
275 pp_cache[i]->b_used = false;
277 if( pp_cache[i]->b_junk ) continue;
279 pp_cache[i]->p_module = vlc_module_create( p_this );
281 /* Load additional infos */
282 free( pp_cache[i]->p_module->psz_object_name );
283 LOAD_STRING( pp_cache[i]->p_module->psz_object_name );
284 LOAD_STRING( pp_cache[i]->p_module->psz_shortname );
285 LOAD_STRING( pp_cache[i]->p_module->psz_longname );
286 LOAD_STRING( pp_cache[i]->p_module->psz_help );
287 for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
289 LOAD_STRING( pp_cache[i]->p_module->pp_shortcuts[j] ); // FIX
291 LOAD_STRING( pp_cache[i]->p_module->psz_capability );
292 LOAD_IMMEDIATE( pp_cache[i]->p_module->i_score );
293 LOAD_IMMEDIATE( pp_cache[i]->p_module->i_cpu );
294 LOAD_IMMEDIATE( pp_cache[i]->p_module->b_unloadable );
295 LOAD_IMMEDIATE( pp_cache[i]->p_module->b_reentrant );
296 LOAD_IMMEDIATE( pp_cache[i]->p_module->b_submodule );
299 if( CacheLoadConfig( pp_cache[i]->p_module, file ) != VLC_SUCCESS )
302 LOAD_STRING( pp_cache[i]->p_module->psz_filename );
304 LOAD_IMMEDIATE( i_submodules );
306 while( i_submodules-- )
308 module_t *p_module = vlc_submodule_create( pp_cache[i]->p_module );
309 free( p_module->psz_object_name );
310 LOAD_STRING( p_module->psz_object_name );
311 LOAD_STRING( p_module->psz_shortname );
312 LOAD_STRING( p_module->psz_longname );
313 LOAD_STRING( p_module->psz_help );
314 for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
316 LOAD_STRING( p_module->pp_shortcuts[j] ); // FIX
318 LOAD_STRING( p_module->psz_capability );
319 LOAD_IMMEDIATE( p_module->i_score );
320 LOAD_IMMEDIATE( p_module->i_cpu );
321 LOAD_IMMEDIATE( p_module->b_unloadable );
322 LOAD_IMMEDIATE( p_module->b_reentrant );
331 msg_Warn( p_this, "plugins cache not loaded (corrupted)" );
334 p_libvlc_global->p_module_bank->i_loaded_cache = 0;
341 static int CacheLoadConfig( module_t *p_module, FILE *file )
346 /* Calculate the structure length */
347 LOAD_IMMEDIATE( p_module->i_config_items );
348 LOAD_IMMEDIATE( p_module->i_bool_items );
350 LOAD_IMMEDIATE( i_lines );
352 /* Allocate memory */
356 (module_config_t *)calloc( i_lines, sizeof(module_config_t) );
357 if( p_module->p_config == NULL )
359 p_module->confsize = 0;
360 msg_Err( p_module, "config error: can't duplicate p_config" );
364 p_module->confsize = i_lines;
366 /* Do the duplication job */
367 for (size_t i = 0; i < i_lines; i++ )
369 LOAD_IMMEDIATE( p_module->p_config[i] );
371 LOAD_STRING( p_module->p_config[i].psz_type );
372 LOAD_STRING( p_module->p_config[i].psz_name );
373 LOAD_STRING( p_module->p_config[i].psz_text );
374 LOAD_STRING( p_module->p_config[i].psz_longtext );
375 LOAD_STRING( p_module->p_config[i].psz_oldname );
376 LOAD_IMMEDIATE( p_module->p_config[i].b_removed );
378 if (IsConfigStringType (p_module->p_config[i].i_type))
380 LOAD_STRING (p_module->p_config[i].orig.psz);
381 p_module->p_config[i].value.psz =
382 (p_module->p_config[i].orig.psz != NULL)
383 ? strdup (p_module->p_config[i].orig.psz) : NULL;
384 p_module->p_config[i].saved.psz = NULL;
388 memcpy (&p_module->p_config[i].value, &p_module->p_config[i].orig,
389 sizeof (p_module->p_config[i].value));
390 memcpy (&p_module->p_config[i].saved, &p_module->p_config[i].orig,
391 sizeof (p_module->p_config[i].saved));
394 p_module->p_config[i].b_dirty = false;
396 p_module->p_config[i].p_lock = &(vlc_internals(p_module)->lock);
398 if( p_module->p_config[i].i_list )
400 if( p_module->p_config[i].ppsz_list )
403 p_module->p_config[i].ppsz_list =
404 malloc( (p_module->p_config[i].i_list+1) * sizeof(char *));
405 if( p_module->p_config[i].ppsz_list )
407 for( j = 0; j < p_module->p_config[i].i_list; j++ )
408 LOAD_STRING( p_module->p_config[i].ppsz_list[j] );
409 p_module->p_config[i].ppsz_list[j] = NULL;
412 if( p_module->p_config[i].ppsz_list_text )
415 p_module->p_config[i].ppsz_list_text =
416 malloc( (p_module->p_config[i].i_list+1) * sizeof(char *));
417 if( p_module->p_config[i].ppsz_list_text )
419 for( j = 0; j < p_module->p_config[i].i_list; j++ )
420 LOAD_STRING( p_module->p_config[i].ppsz_list_text[j] );
421 p_module->p_config[i].ppsz_list_text[j] = NULL;
424 if( p_module->p_config[i].pi_list )
426 p_module->p_config[i].pi_list =
427 malloc( (p_module->p_config[i].i_list + 1) * sizeof(int) );
428 if( p_module->p_config[i].pi_list )
430 for (int j = 0; j < p_module->p_config[i].i_list; j++)
431 LOAD_IMMEDIATE( p_module->p_config[i].pi_list[j] );
436 if( p_module->p_config[i].i_action )
438 p_module->p_config[i].ppf_action =
439 malloc( p_module->p_config[i].i_action * sizeof(void *) );
440 p_module->p_config[i].ppsz_action_text =
441 malloc( p_module->p_config[i].i_action * sizeof(char *) );
443 for (int j = 0; j < p_module->p_config[i].i_action; j++)
445 p_module->p_config[i].ppf_action[j] = 0;
446 LOAD_STRING( p_module->p_config[i].ppsz_action_text[j] );
450 LOAD_IMMEDIATE( p_module->p_config[i].pf_callback );
460 /*****************************************************************************
461 * SavePluginsCache: saves the plugins cache to a file
462 *****************************************************************************/
463 void CacheSave( vlc_object_t *p_this )
465 static char const psz_tag[] =
466 "Signature: 8a477f597d28d172789f06886806bc55\r\n"
467 "# This file is a cache directory tag created by VLC.\r\n"
468 "# For information about cache directory tags, see:\r\n"
469 "# http://www.brynosaurus.com/cachedir/\r\n";
471 char *psz_cachedir = config_GetCacheDir();
474 module_cache_t **pp_cache;
475 uint32_t i_file_size = 0;
476 libvlc_global_data_t *p_libvlc_global = vlc_global();
478 if( !psz_cachedir ) /* XXX: this should never happen */
480 msg_Err( p_this, "unable to get cache directory" );
484 char psz_filename[sizeof(DIR_SEP) + 32 + strlen(psz_cachedir)];
485 config_CreateDir( p_this, psz_cachedir );
487 snprintf( psz_filename, sizeof( psz_filename ),
488 "%s"DIR_SEP"CACHEDIR.TAG", psz_cachedir );
489 file = utf8_fopen( psz_filename, "wb" );
492 if (fwrite (psz_tag, 1, sizeof (psz_tag) - 1, file) != 1)
493 clearerr (file); /* what else can we do? */
497 snprintf( psz_filename, sizeof( psz_filename ),
498 "%s"DIR_SEP"%s", psz_cachedir, CacheName() );
499 free( psz_cachedir );
500 msg_Dbg( p_this, "writing plugins cache %s", psz_filename );
502 file = utf8_fopen( psz_filename, "wb" );
506 /* Empty space for file size */
507 if (fwrite (&i_file_size, sizeof (i_file_size), 1, file) != 1)
510 /* Contains version number */
511 if (fputs ("cache "COPYRIGHT_MESSAGE, file) == EOF)
513 #ifdef DISTRO_VERSION
514 /* Allow binary maintaner to pass a string to detect new binary version*/
515 if (fputs( DISTRO_VERSION, file ) == EOF)
518 /* Sub-version number (to avoid breakage in the dev version when cache
519 * structure changes) */
520 i_file_size = CACHE_SUBVERSION_NUM;
521 if (fwrite (&i_file_size, sizeof (i_file_size), 1, file) != 1 )
525 if (fprintf (file, "%5.5s", _("C")) == EOF)
529 i_file_size = ftell( file );
530 if (fwrite (&i_file_size, sizeof (i_file_size), 1, file) != 1)
533 i_cache = p_libvlc_global->p_module_bank->i_cache;
534 pp_cache = p_libvlc_global->p_module_bank->pp_cache;
536 if (fwrite( &i_cache, sizeof (i_cache), 1, file) != 1)
539 #define SAVE_IMMEDIATE( a ) \
540 if (fwrite (&a, sizeof(a), 1, file) != 1) \
542 #define SAVE_STRING( a ) \
544 uint16_t i_size = (a != NULL) ? (strlen (a) + 1) : 0; \
545 if ((fwrite (&i_size, sizeof (i_size), 1, file) != 1) \
546 || (a && (fwrite (a, 1, i_size, file) != i_size))) \
550 for( i = 0; i < i_cache; i++ )
552 uint32_t i_submodule;
554 /* Save common info */
555 SAVE_STRING( pp_cache[i]->psz_file );
556 SAVE_IMMEDIATE( pp_cache[i]->i_time );
557 SAVE_IMMEDIATE( pp_cache[i]->i_size );
558 SAVE_IMMEDIATE( pp_cache[i]->b_junk );
560 if( pp_cache[i]->b_junk ) continue;
562 /* Save additional infos */
563 SAVE_STRING( pp_cache[i]->p_module->psz_object_name );
564 SAVE_STRING( pp_cache[i]->p_module->psz_shortname );
565 SAVE_STRING( pp_cache[i]->p_module->psz_longname );
566 SAVE_STRING( pp_cache[i]->p_module->psz_help );
567 for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
569 SAVE_STRING( pp_cache[i]->p_module->pp_shortcuts[j] ); // FIX
571 SAVE_STRING( pp_cache[i]->p_module->psz_capability );
572 SAVE_IMMEDIATE( pp_cache[i]->p_module->i_score );
573 SAVE_IMMEDIATE( pp_cache[i]->p_module->i_cpu );
574 SAVE_IMMEDIATE( pp_cache[i]->p_module->b_unloadable );
575 SAVE_IMMEDIATE( pp_cache[i]->p_module->b_reentrant );
576 SAVE_IMMEDIATE( pp_cache[i]->p_module->b_submodule );
579 if (CacheSaveConfig (pp_cache[i]->p_module, file))
582 SAVE_STRING( pp_cache[i]->p_module->psz_filename );
584 i_submodule = vlc_internals( pp_cache[i]->p_module )->i_children;
585 SAVE_IMMEDIATE( i_submodule );
586 for( i_submodule = 0;
587 i_submodule < (unsigned)vlc_internals( pp_cache[i]->p_module)->i_children;
591 (module_t *)vlc_internals( pp_cache[i]->p_module )->pp_children[i_submodule];
593 SAVE_STRING( p_module->psz_object_name );
594 SAVE_STRING( p_module->psz_shortname );
595 SAVE_STRING( p_module->psz_longname );
596 SAVE_STRING( p_module->psz_help );
597 for( j = 0; j < MODULE_SHORTCUT_MAX; j++ )
599 SAVE_STRING( p_module->pp_shortcuts[j] ); // FIX
601 SAVE_STRING( p_module->psz_capability );
602 SAVE_IMMEDIATE( p_module->i_score );
603 SAVE_IMMEDIATE( p_module->i_cpu );
604 SAVE_IMMEDIATE( p_module->b_unloadable );
605 SAVE_IMMEDIATE( p_module->b_reentrant );
609 /* Fill-up file size */
610 i_file_size = ftell( file );
611 fseek( file, 0, SEEK_SET );
612 if (fwrite (&i_file_size, sizeof (i_file_size), 1, file) != 1)
615 if (fclose (file) == 0)
616 return; /* success! */
620 msg_Warn (p_this, "could not write plugins cache %s (%m)",
629 static int CacheSaveConfig( module_t *p_module, FILE *file )
631 uint32_t i_lines = p_module->confsize;
633 SAVE_IMMEDIATE( p_module->i_config_items );
634 SAVE_IMMEDIATE( p_module->i_bool_items );
635 SAVE_IMMEDIATE( i_lines );
637 for (size_t i = 0; i < i_lines ; i++)
639 SAVE_IMMEDIATE( p_module->p_config[i] );
641 SAVE_STRING( p_module->p_config[i].psz_type );
642 SAVE_STRING( p_module->p_config[i].psz_name );
643 SAVE_STRING( p_module->p_config[i].psz_text );
644 SAVE_STRING( p_module->p_config[i].psz_longtext );
645 SAVE_STRING( p_module->p_config[i].psz_oldname );
646 SAVE_IMMEDIATE( p_module->p_config[i].b_removed );
648 if (IsConfigStringType (p_module->p_config[i].i_type))
649 SAVE_STRING( p_module->p_config[i].orig.psz );
651 if( p_module->p_config[i].i_list )
653 if( p_module->p_config[i].ppsz_list )
655 for (int j = 0; j < p_module->p_config[i].i_list; j++)
656 SAVE_STRING( p_module->p_config[i].ppsz_list[j] );
659 if( p_module->p_config[i].ppsz_list_text )
661 for (int j = 0; j < p_module->p_config[i].i_list; j++)
662 SAVE_STRING( p_module->p_config[i].ppsz_list_text[j] );
664 if( p_module->p_config[i].pi_list )
666 for (int j = 0; j < p_module->p_config[i].i_list; j++)
667 SAVE_IMMEDIATE( p_module->p_config[i].pi_list[j] );
671 for (int j = 0; j < p_module->p_config[i].i_action; j++)
672 SAVE_STRING( p_module->p_config[i].ppsz_action_text[j] );
674 SAVE_IMMEDIATE( p_module->p_config[i].pf_callback );
682 /*****************************************************************************
683 * CacheName: Return the cache file name for this platform.
684 *****************************************************************************/
685 static char *CacheName( void )
687 static char psz_cachename[32];
689 /* Code int size, pointer size and endianness in the filename */
690 int32_t x = 0xbe00001e;
691 sprintf( psz_cachename, "plugins-%.2x%.2x%.2x.dat", (int)sizeof(int),
692 (int)sizeof(void *), (unsigned int)((unsigned char *)&x)[0] );
693 return psz_cachename;
696 /*****************************************************************************
697 * CacheMerge: Merge a cache module descriptor with a full module descriptor.
698 *****************************************************************************/
699 void CacheMerge( vlc_object_t *p_this, module_t *p_cache, module_t *p_module )
704 p_cache->pf_activate = p_module->pf_activate;
705 p_cache->pf_deactivate = p_module->pf_deactivate;
706 p_cache->handle = p_module->handle;
708 for( i_submodule = 0; i_submodule < vlc_internals( p_module )->i_children; i_submodule++ )
710 module_t *p_child = (module_t*)vlc_internals( p_module )->pp_children[i_submodule];
711 module_t *p_cchild = (module_t*)vlc_internals( p_cache )->pp_children[i_submodule];
712 p_cchild->pf_activate = p_child->pf_activate;
713 p_cchild->pf_deactivate = p_child->pf_deactivate;
716 p_cache->b_loaded = true;
717 p_module->b_loaded = false;
720 /*****************************************************************************
721 * CacheFind: finds the cache entry corresponding to a file
722 *****************************************************************************/
723 module_cache_t *CacheFind( const char *psz_file,
724 int64_t i_time, int64_t i_size )
726 module_cache_t **pp_cache;
728 libvlc_global_data_t *p_libvlc_global = vlc_global();
730 pp_cache = p_libvlc_global->p_module_bank->pp_loaded_cache;
731 i_cache = p_libvlc_global->p_module_bank->i_loaded_cache;
733 for( i = 0; i < i_cache; i++ )
735 if( !strcmp( pp_cache[i]->psz_file, psz_file ) &&
736 pp_cache[i]->i_time == i_time &&
737 pp_cache[i]->i_size == i_size ) return pp_cache[i];
743 #endif /* HAVE_DYNAMIC_PLUGINS */