More const usage
authorlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 12 Apr 2005 08:29:36 +0000 (08:29 +0000)
committerlilo_booter <lilo_booter@d19143bc-622f-0410-bfdd-b5b2a6649095>
Tue, 12 Apr 2005 08:29:36 +0000 (08:29 +0000)
git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@692 d19143bc-622f-0410-bfdd-b5b2a6649095

src/framework/mlt_factory.c
src/framework/mlt_factory.h
src/framework/mlt_repository.c
src/framework/mlt_repository.h

index e13662d..1272a8e 100644 (file)
@@ -57,7 +57,7 @@ static void mlt_factory_create_done( mlt_listener listener, mlt_properties owner
 /** Construct the factories.
 */
 
-int mlt_factory_init( char *prefix )
+int mlt_factory_init( const char *prefix )
 {
        // Only initialise once
        if ( mlt_prefix == NULL )
@@ -130,7 +130,7 @@ const char *mlt_factory_prefix( )
 /** Get a value from the environment.
 */
 
-char *mlt_environment( char *name )
+char *mlt_environment( const char *name )
 {
        return mlt_properties_get( global_properties, name );
 }
@@ -138,7 +138,7 @@ char *mlt_environment( char *name )
 /** Fetch a producer from the repository.
 */
 
-mlt_producer mlt_factory_producer( char *service, void *input )
+mlt_producer mlt_factory_producer( const char *service, void *input )
 {
        mlt_producer obj = NULL;
 
@@ -169,7 +169,7 @@ mlt_producer mlt_factory_producer( char *service, void *input )
 /** Fetch a filter from the repository.
 */
 
-mlt_filter mlt_factory_filter( char *service, void *input )
+mlt_filter mlt_factory_filter( const char *service, void *input )
 {
        mlt_filter obj = NULL;
 
@@ -195,7 +195,7 @@ mlt_filter mlt_factory_filter( char *service, void *input )
 /** Fetch a transition from the repository.
 */
 
-mlt_transition mlt_factory_transition( char *service, void *input )
+mlt_transition mlt_factory_transition( const char *service, void *input )
 {
        mlt_transition obj = NULL;
 
@@ -221,7 +221,7 @@ mlt_transition mlt_factory_transition( char *service, void *input )
 /** Fetch a consumer from the repository
 */
 
-mlt_consumer mlt_factory_consumer( char *service, void *input )
+mlt_consumer mlt_factory_consumer( const char *service, void *input )
 {
        mlt_consumer obj = NULL;
 
index 219e5f5..218c0f0 100644 (file)
 
 #include "mlt_types.h"
 
-extern int mlt_factory_init( char *prefix );
+extern int mlt_factory_init( const char *prefix );
 extern const char *mlt_factory_prefix( );
-extern char *mlt_environment( char *name );
+extern char *mlt_environment( const char *name );
 extern mlt_properties mlt_factory_event_object( );
-extern mlt_producer mlt_factory_producer( char *name, void *input );
-extern mlt_filter mlt_factory_filter( char *name, void *input );
-extern mlt_transition mlt_factory_transition( char *name, void *input );
-extern mlt_consumer mlt_factory_consumer( char *name, void *input );
+extern mlt_producer mlt_factory_producer( const char *name, void *input );
+extern mlt_filter mlt_factory_filter( const char *name, void *input );
+extern mlt_transition mlt_factory_transition( const char *name, void *input );
+extern mlt_consumer mlt_factory_consumer( const char *name, void *input );
 extern void mlt_factory_register_for_clean_up( void *ptr, mlt_destructor destructor );
 extern void mlt_factory_close( );
 
index cdda3db..d0dbcd9 100644 (file)
@@ -31,7 +31,7 @@ struct mlt_repository_s
        struct mlt_properties_s parent;
 };
 
-static char *construct_full_file( char *output, char *prefix, char *file )
+static char *construct_full_file( char *output, const char *prefix, const char *file )
 {
        strcpy( output, prefix );
        if ( prefix[ strlen( prefix ) - 1 ] != '/' )
@@ -47,7 +47,7 @@ static char *chomp( char *input )
        return input;
 }
 
-static mlt_properties construct_object( char *prefix, char *id )
+static mlt_properties construct_object( const char *prefix, const char *id )
 {
        mlt_properties output = mlt_properties_new( );
        mlt_properties_set( output, "prefix", prefix );
@@ -55,7 +55,7 @@ static mlt_properties construct_object( char *prefix, char *id )
        return output;
 }
 
-static mlt_properties construct_service( mlt_properties object, char *id )
+static mlt_properties construct_service( mlt_properties object, const char *id )
 {
        mlt_properties output = mlt_properties_new( );
        mlt_properties_set_data( output, "object", object, 0, NULL, NULL );
@@ -63,7 +63,7 @@ static mlt_properties construct_service( mlt_properties object, char *id )
        return output;
 }
 
-static void *construct_instance( mlt_properties service_properties, char *symbol, void *input )
+static void *construct_instance( mlt_properties service_properties, const char *symbol, void *input )
 {
        // Extract the service
        char *service = mlt_properties_get( service_properties, "id" );
@@ -75,7 +75,7 @@ static void *construct_instance( mlt_properties service_properties, char *symbol
        void *object = mlt_properties_get_data( object_properties, "dlopen", NULL );
 
        // Get the dlsym'd symbol
-       void *( *symbol_ptr )( char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL );
+       void *( *symbol_ptr )( const char *, void * ) = mlt_properties_get_data( object_properties, symbol, NULL );
 
        // Check that we have object and open if we don't
        if ( object == NULL )
@@ -116,7 +116,7 @@ static void *construct_instance( mlt_properties service_properties, char *symbol
        return symbol_ptr != NULL ? symbol_ptr( service, input ) : NULL;
 }
 
-mlt_repository mlt_repository_init( mlt_properties object_list, char *prefix, char *data, char *symbol )
+mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *data, const char *symbol )
 {
        char full_file[ 512 ];
        FILE *file;
@@ -176,7 +176,7 @@ mlt_repository mlt_repository_init( mlt_properties object_list, char *prefix, ch
        return this;
 }
 
-void *mlt_repository_fetch( mlt_repository this, char *service, void *input )
+void *mlt_repository_fetch( mlt_repository this, const char *service, void *input )
 {
        // Get the service properties
        mlt_properties service_properties = mlt_properties_get_data( &this->parent, service, NULL );
index 1d99dff..cefdd23 100644 (file)
@@ -31,8 +31,8 @@ typedef struct mlt_repository_s *mlt_repository;
 /** Public functions.
 */
 
-extern mlt_repository mlt_repository_init( mlt_properties object_list, char *prefix, char *file, char *symbol );
-extern void *mlt_repository_fetch( mlt_repository self, char *service, void *input );
+extern mlt_repository mlt_repository_init( mlt_properties object_list, const char *prefix, const char *file, const char *symbol );
+extern void *mlt_repository_fetch( mlt_repository self, const char *service, void *input );
 extern void mlt_repository_close( mlt_repository self );
 
 #endif