#include <dirent.h>
#include <sys/stat.h>
+/** the default subdirectory of the datadir for holding presets */
+#define PRESETS_DIR "/presets"
+
/** \brief Repository class
*
* The Repository is a collection of plugin modules and their services and service metadata.
return NULL;
// Construct the repository
- mlt_repository self = calloc( sizeof( struct mlt_repository_s ), 1 );
+ mlt_repository self = calloc( 1, sizeof( struct mlt_repository_s ));
mlt_properties_init( &self->parent, self );
self->consumers = mlt_properties_new();
self->filters = mlt_properties_new();
}
else
{
- path = malloc( strlen( mlt_environment( "MLT_DATA" ) ) + 9 );
+ path = malloc( strlen( mlt_environment( "MLT_DATA" ) ) + strlen( PRESETS_DIR ) + 1 );
strcpy( path, mlt_environment( "MLT_DATA" ) );
- strcat( path, "/presets" );
+ strcat( path, PRESETS_DIR );
}
list_presets( result, NULL, path );
free( path );