--- /dev/null
+*.o
+*.so
+*.so.*
+config.mak
+config.h
+.depend
* \return true if there was an error
*/
-int mlt_events_register( mlt_properties this, char *id, mlt_transmitter transmitter )
+int mlt_events_register( mlt_properties this, const char *id, mlt_transmitter transmitter )
{
int error = 1;
mlt_events events = mlt_events_fetch( this );
* \param id the name of an event
*/
-void mlt_events_fire( mlt_properties this, char *id, ... )
+void mlt_events_fire( mlt_properties this, const char *id, ... )
{
mlt_events events = mlt_events_fetch( this );
if ( events != NULL )
* \return
*/
-mlt_event mlt_events_listen( mlt_properties this, void *service, char *id, mlt_listener listener )
+mlt_event mlt_events_listen( mlt_properties this, void *service, const char *id, mlt_listener listener )
{
mlt_event event = NULL;
mlt_events events = mlt_events_fetch( this );
* \return an event
*/
-mlt_event mlt_events_setup_wait_for( mlt_properties this, char *id )
+mlt_event mlt_events_setup_wait_for( mlt_properties this, const char *id )
{
condition_pair *pair = malloc( sizeof( condition_pair ) );
pair->done = 0;
#endif
extern void mlt_events_init( mlt_properties self );
-extern int mlt_events_register( mlt_properties self, char *id, mlt_transmitter transmitter );
-extern void mlt_events_fire( mlt_properties self, char *id, ... );
-extern mlt_event mlt_events_listen( mlt_properties self, void *service, char *id, mlt_listener listener );
+extern int mlt_events_register( mlt_properties self, const char *id, mlt_transmitter transmitter );
+extern void mlt_events_fire( mlt_properties self, const char *id, ... );
+extern mlt_event mlt_events_listen( mlt_properties self, void *service, const char *id, mlt_listener listener );
extern void mlt_events_block( mlt_properties self, void *service );
extern void mlt_events_unblock( mlt_properties self, void *service );
extern void mlt_events_disconnect( mlt_properties self, void *service );
-extern mlt_event mlt_events_setup_wait_for( mlt_properties self, char *id );
+extern mlt_event mlt_events_setup_wait_for( mlt_properties self, const char *id );
extern void mlt_events_wait_for( mlt_properties self, mlt_event event );
extern void mlt_events_close_wait_for( mlt_properties self, mlt_event event );
* \return a new producer
*/
-mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, void *input )
+mlt_producer mlt_factory_producer( mlt_profile profile, const char *service, const void *input )
{
mlt_producer obj = NULL;
* \return a new filter
*/
-mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, void *input )
+mlt_filter mlt_factory_filter( mlt_profile profile, const char *service, const void *input )
{
mlt_filter obj = NULL;
* \return a new transition
*/
-mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, void *input )
+mlt_transition mlt_factory_transition( mlt_profile profile, const char *service, const void *input )
{
mlt_transition obj = NULL;
* \return a new consumer
*/
-mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, void *input )
+mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *service, const void *input )
{
mlt_consumer obj = NULL;
extern char *mlt_environment( const char *name );
extern int mlt_environment_set( const char *name, const char *value );
extern mlt_properties mlt_factory_event_object( );
-extern mlt_producer mlt_factory_producer( mlt_profile profile, const char *name, void *input );
-extern mlt_filter mlt_factory_filter( mlt_profile profile, const char *name, void *input );
-extern mlt_transition mlt_factory_transition( mlt_profile profile, const char *name, void *input );
-extern mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *name, void *input );
+extern mlt_producer mlt_factory_producer( mlt_profile profile, const char *name, const void *input );
+extern mlt_filter mlt_factory_filter( mlt_profile profile, const char *name, const void *input );
+extern mlt_transition mlt_factory_transition( mlt_profile profile, const char *name, const void *input );
+extern mlt_consumer mlt_factory_consumer( mlt_profile profile, const char *name, const void *input );
extern void mlt_factory_register_for_clean_up( void *ptr, mlt_destructor destructor );
extern void mlt_factory_close( );
extern mlt_properties mlt_global_properties( );
static int position_compare( const void *p1, const void *p2 )
{
- return *( mlt_position * )p1 - *( mlt_position * )p2;
+ return *( const mlt_position * )p1 - *( const mlt_position * )p2;
}
/** Add a position to a set.
{
char *props = strdup( list );
char *ptr = props;
- char *delim = " ,\t\n"; // Any combination of spaces, commas, tabs, and newlines
+ const char *delim = " ,\t\n"; // Any combination of spaces, commas, tabs, and newlines
int count, done = 0;
while( !done )
static int mlt_compare( const void *this, const void *that )
{
- return strcmp( mlt_property_get_string( *( mlt_property * )this ), mlt_property_get_string( *( mlt_property * )that ) );
+ return strcmp( mlt_property_get_string( *( const mlt_property * )this ), mlt_property_get_string( *( const mlt_property * )that ) );
}
/** Get the contents of a directory.
* \param input an optional argument to the service constructor
*/
-void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, void *input )
+void *mlt_repository_create( mlt_repository this, mlt_profile profile, mlt_service_type type, const char *service, const void *input )
{
mlt_properties properties = get_service_properties( this, type, service );
if ( properties != NULL )
/** The callback function that modules implement to construct a service.
*/
-typedef void *( *mlt_register_callback )( mlt_profile, mlt_service_type, const char * /* service name */, void * /* arg */ );
+typedef void *( *mlt_register_callback )( mlt_profile, mlt_service_type, const char * /* service name */, const void * /* arg */ );
/** The callback function that modules implement to supply metadata as a properties list.
*/
extern mlt_repository mlt_repository_init( const char *directory );
extern void mlt_repository_register( mlt_repository self, mlt_service_type service_type, const char *service, mlt_register_callback );
-extern void *mlt_repository_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, void *arg );
+extern void *mlt_repository_create( mlt_repository self, mlt_profile profile, mlt_service_type type, const char *service, const void *arg );
extern void mlt_repository_close( mlt_repository self );
extern mlt_properties mlt_repository_consumers( mlt_repository self );
extern mlt_properties mlt_repository_filters( mlt_repository self );
/** Parse a string by splitting on the delimiter provided.
*/
-int mlt_tokeniser_parse_new( mlt_tokeniser tokeniser, char *string, char *delimiter )
+int mlt_tokeniser_parse_new( mlt_tokeniser tokeniser, char *string, const char *delimiter )
{
int count = 0;
int length = strlen( string );
*/
extern mlt_tokeniser mlt_tokeniser_init( );
-extern int mlt_tokeniser_parse_new( mlt_tokeniser self, char *text, char *delimiter );
+extern int mlt_tokeniser_parse_new( mlt_tokeniser self, char *text, const char *delimiter );
extern char *mlt_tokeniser_get_input( mlt_tokeniser self );
extern int mlt_tokeniser_count( mlt_tokeniser self );
extern char *mlt_tokeniser_get_string( mlt_tokeniser self, int index );
typedef struct
{
- char *description;
+ const char *description;
struct menu_item
{
- char *option;
+ const char *option;
demo_function function;
}
array[ 50 ];
if ( refresh )
{
- char *action = "Load & Play";
+ const char *action = "Load & Play";
if ( demo->queues[ demo->selected_unit ].mode )
action = "Queue";
printf( "%s from %s\n\n", action, demo->current_directory );
valerie_error_code dv_demo_run_menu( dv_demo demo, dv_demo_menu menu )
{
- char *items = "123456789abcdefghijklmnopqrstuvwxyz";
+ const char *items = "123456789abcdefghijklmnopqrstuvwxyz";
int refresh_menu = 1;
int terminated = 0;
int item_count = 0;
return input;
}
-char *io_get_string( char *output, int maxlength, char *use )
+char *io_get_string( char *output, int maxlength, const char *use )
{
char *value = NULL;
strcpy( output, use );
return value;
}
-void wait_for_any_key( char *message )
+void wait_for_any_key( const char *message )
{
if ( message == NULL )
printf( "Press any key to continue: " );
extern char *chomp( char * );
extern char *trim( char * );
extern char *strip_quotes( char * );
-extern char *io_get_string( char *, int, char * );
+extern char *io_get_string( char *, int, const char * );
extern int *get_int( int *, int );
extern void term_init( );
extern int term_read( );
extern void term_exit( );
extern char get_keypress( );
-extern void wait_for_any_key( char * );
+extern void wait_for_any_key( const char * );
extern void beep( );
#endif
}
}
-static void query_metadata( mlt_repository repo, mlt_service_type type, char *typestr, char *id )
+static void query_metadata( mlt_repository repo, mlt_service_type type, const char *typestr, char *id )
{
mlt_properties metadata = mlt_repository_metadata( repo, type, id );
if ( metadata )
static void query_services( mlt_repository repo, mlt_service_type type )
{
mlt_properties services = NULL;
- char *typestr = NULL;
+ const char *typestr = NULL;
switch ( type )
{
case consumer_type:
}
else
{
- char *message = "500 Empty Response\r\n\r\n";
+ const char *message = "500 Empty Response\r\n\r\n";
write( fd, message, strlen( message ) );
}
typedef struct
{
int code;
- char *message;
+ const char *message;
}
responses_t;
typedef struct
{
/* The command string corresponding to this operation (e.g. "play") */
- char *command;
+ const char *command;
/* The function associated with it */
response_codes (*operation) ( command_argument );
/* a boolean to indicate if this is a unit or global command
/* What type is the argument (RTTI :-) ATYPE_whatever */
int type;
/* online help information */
- char *help;
+ const char *help;
}
command_t;
/** Lookup the response message for a status code.
*/
-inline char *get_response_msg( int code )
+inline const char *get_response_msg( int code )
{
int i = 0;
for ( i = 0; responses[ i ].message != NULL && code != responses[ i ].code; i ++ ) ;
}
-void miracle_log( int priority, char *format, ... )
+void miracle_log( int priority, const char *format, ... )
{
va_list list;
va_start( list, format );
};
void miracle_log_init( enum log_output method, int threshold );
-void miracle_log( int priority, char *format, ... );
+void miracle_log( int priority, const char *format, ... );
#ifdef __cplusplus
}
return server != NULL && server->id != NULL ? server->id : "miracle";
}
-void miracle_server_set_config( miracle_server server, char *config )
+void miracle_server_set_config( miracle_server server, const char *config )
{
if ( server != NULL )
{
extern miracle_server miracle_server_init( char * );
extern const char *miracle_server_id( miracle_server );
-extern void miracle_server_set_config( miracle_server, char * );
+extern void miracle_server_set_config( miracle_server, const char * );
extern void miracle_server_set_port( miracle_server, int );
extern void miracle_server_set_proxy( miracle_server, char * );
extern int miracle_server_execute( miracle_server );
// Determine the format
AVOutputFormat *fmt = NULL;
- char *filename = mlt_properties_get( properties, "target" );
+ const char *filename = mlt_properties_get( properties, "target" );
char *format = mlt_properties_get( properties, "f" );
char *vcodec = mlt_properties_get( properties, "vcodec" );
char *acodec = mlt_properties_get( properties, "acodec" );
// Remove the x264 dual pass logs
char *cwd = getcwd( NULL, 0 );
- char *file = "x264_2pass.log";
+ const char *file = "x264_2pass.log";
char *full = malloc( strlen( cwd ) + strlen( file ) + 2 );
sprintf( full, "%s/%s", cwd, file );
remove( full );
static mlt_properties avformat_metadata( mlt_service_type type, const char *id, void *data )
{
char file[ PATH_MAX ];
- char *service_type = NULL;
+ const char *service_type = NULL;
switch ( type )
{
case consumer_type:
{
int i = 0;
mlt_properties properties = MLT_FILTER_PROPERTIES( requested );
- static char *prefix = "properties.";
+ static const char *prefix = "properties.";
int len = strlen( prefix );
// Determine if this is an absolute or relative feed
char temp[ 132 ];
int count = 0;
uint8_t *alpha = NULL;
- char *rescale = mlt_properties_get( a_props, "rescale.interp" );
+ const char *rescale = mlt_properties_get( a_props, "rescale.interp" );
if ( rescale == NULL || !strcmp( rescale, "none" ) )
rescale = "hyper";
mlt_transition_process( composite, b_frame, frame );
return length * ( y - x ) / 2.0;
}
-static int get_value( mlt_properties properties, char *preferred, char *fallback )
+static int get_value( mlt_properties properties, const char *preferred, const char *fallback )
{
int value = mlt_properties_get_int( properties, preferred );
if ( value == 0 )
uint8_t *alpha_b = NULL;
// Composites always need scaling... defaulting to lowest
- char *rescale = mlt_properties_get( a_props, "rescale.interp" );
+ const char *rescale = mlt_properties_get( a_props, "rescale.interp" );
if ( rescale == NULL || !strcmp( rescale, "none" ) )
rescale = "nearest";
mlt_properties_set( a_props, "rescale.interp", rescale );
if ( composite != NULL )
{
// Get the resource of this filter (could be a shape [rectangle/circle] or an alpha provider of choice
- char *resource = mlt_properties_get( properties, "resource" );
+ const char *resource = mlt_properties_get( properties, "resource" );
// Get the old resource in case it's changed
char *old_resource = mlt_properties_get( properties, "_old_resource" );
int i;
int R, G, B;
const RGB32 *p;
- short *q;
+ const short *q;
unsigned char *r;
int v;
p = src;
- q = (short *)background;
+ q = (const short *)background;
r = diff;
for(i=0; i<video_area; i++) {
/* FIXME: endianess */
void image_edge(unsigned char *diff2, const RGB32 *src, int width, int height, int y_threshold)
{
int x, y;
- unsigned char *p, *q;
+ const unsigned char *p;
+ unsigned char *q;
int r, g, b;
int ar, ag, ab;
int w;
- p = (unsigned char *)src;
+ p = (const unsigned char *)src;
q = diff2;
w = width * sizeof(RGB32);
( *strrchr( markup, '.' ) ) = '\0';
while ( strchr( markup, '~' ) )
( *strchr( markup, '~' ) ) = '\n';
- mlt_properties_set( properties, "resource", ( char * )filename );
+ mlt_properties_set( properties, "resource", filename );
mlt_properties_set( properties, "markup", markup );
free( copy );
}
mlt_properties contents = mlt_properties_load( filename );
mlt_geometry key_frames = mlt_geometry_init( );
struct mlt_geometry_item_s item;
- mlt_properties_set( properties, "resource", ( char * )filename );
+ mlt_properties_set( properties, "resource", filename );
mlt_properties_set_data( properties, "contents", contents, 0, ( mlt_destructor )mlt_properties_close, NULL );
mlt_properties_set_data( properties, "key_frames", key_frames, 0, ( mlt_destructor )mlt_geometry_close, NULL );
if ( markup[ strlen( markup ) - 1 ] == '\n' )
markup[ strlen( markup ) - 1 ] = '\0';
- mlt_properties_set( properties, "resource", ( char * ) filename );
- mlt_properties_set( properties, "markup", ( char * ) ( markup == NULL ? "" : markup ) );
+ mlt_properties_set( properties, "resource", filename );
+ mlt_properties_set( properties, "markup", ( markup == NULL ? "" : markup ) );
free( markup );
}
else
return NULL;
}
-static void set_string( char **string, char *value, char *fallback )
+static void set_string( char **string, const char *value, const char *fallback )
{
if ( value != NULL )
{
/** Convert a string property to UTF-8
*/
-static int iconv_utf8( mlt_properties properties, char *prop_name, const char* encoding )
+static int iconv_utf8( mlt_properties properties, const char *prop_name, const char* encoding )
{
char *text = mlt_properties_get( properties, prop_name );
int result = -1;
#ifndef _
#define _(x) x
#endif
-#define _x (xmlChar*)
-#define _s (char*)
+#define _x (const xmlChar*)
+#define _s (const char*)
jack_rack_t *
jack_rack_new (const char * client_name, unsigned long channels)
{
Init();
- fd = quicktime_open( ( char * ) s, 1, 0 );
+ fd = quicktime_open( s, 1, 0 );
if ( fd == NULL )
{
fprintf( stderr, "Error opening: %s\n", s );
int ncompare (const void * a, const void * b)
{
- return ( *(int*)a - *(int*)b );
+ return ( *(const int*)a - *(const int*)b );
}
// motion vector denoising
/** Calculate real geometry.
*/
-static void geometry_calculate( mlt_transition this, char *store, struct mlt_geometry_item_s *output, float position )
+static void geometry_calculate( mlt_transition this, const char *store, struct mlt_geometry_item_s *output, float position )
{
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
mlt_geometry geometry = mlt_properties_get_data( properties, store, NULL );
}
-static mlt_geometry transition_parse_keys( mlt_transition this, char *name, char *store, int normalised_width, int normalised_height )
+static mlt_geometry transition_parse_keys( mlt_transition this, const char *name, const char *store, int normalised_width, int normalised_height )
{
// Get the properties of the transition
mlt_properties properties = MLT_TRANSITION_PROPERTIES( this );
return start;
}
-static inline float composite_calculate_key( mlt_transition this, char *name, char *store, int norm, float position )
+static inline float composite_calculate_key( mlt_transition this, const char *name, const char *store, int norm, float position )
{
// Struct for the result
struct mlt_geometry_item_s result;
#define ID_SIZE 128
-#define _x (xmlChar*)
-#define _s (char*)
+#define _x (const xmlChar*)
+#define _s (const char*)
// This maintains counters for adding ids to elements
struct serialise_context_s
}
}
-static void serialise_store_properties( serialise_context context, mlt_properties properties, xmlNode *node, char *store )
+static void serialise_store_properties( serialise_context context, mlt_properties properties, xmlNode *node, const char *store )
{
int i;
xmlNode *p;
#define STACK_SIZE 1000
#define BRANCH_SIG_LEN 4000
-#define _x (xmlChar*)
-#define _s (char*)
+#define _x (const xmlChar*)
+#define _s (const char*)
#undef DEBUG
#ifdef DEBUG
// Prepend the property value with the document root
-static inline void qualify_property( deserialise_context context, mlt_properties properties, char *name )
+static inline void qualify_property( deserialise_context context, mlt_properties properties, const char *name )
{
char *resource = mlt_properties_get( properties, name );
if ( resource != NULL && resource[0] )
track_service( context->destructors, service, (mlt_destructor) mlt_tractor_close );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
mlt_properties_set_int( MLT_TRACTOR_PROPERTIES( tractor ), "global_feed", 1 );
mlt_service service = MLT_SERVICE( mlt_tractor_multitrack( MLT_TRACTOR( parent ) ) );
mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( properties, (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( properties, (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
if ( mlt_properties_get( properties, "id" ) != NULL )
mlt_properties_set_data( context->producer_map, mlt_properties_get( properties,"id" ), service, 0, NULL, NULL );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
{
- mlt_properties_set( properties, (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( properties, (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
// Out will be overwritten later as we append, so we need to save it
if ( xmlStrcmp( atts[ 0 ], _x("out") ) == 0 )
- mlt_properties_set( properties, "_westley.out", ( char* )atts[ 1 ] );
+ mlt_properties_set( properties, "_westley.out", ( const char* )atts[ 1 ] );
}
if ( mlt_properties_get( properties, "id" ) != NULL )
context_push_service( context, service, mlt_dummy_producer_type );
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( properties, (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( properties, (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
}
// Parse a SMIL clock value (as produced by Kino 0.9.1) and return position in frames
for ( ; atts != NULL && *atts != NULL; atts += 2 )
{
- mlt_properties_set( temp, (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( temp, (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
// Look for the producer attribute
if ( xmlStrcmp( atts[ 0 ], _x("producer") ) == 0 )
{
- mlt_producer producer = mlt_properties_get_data( context->producer_map, (char*) atts[1], NULL );
+ mlt_producer producer = mlt_properties_get_data( context->producer_map, (const char*) atts[1], NULL );
if ( producer != NULL )
mlt_properties_set_data( temp, "producer", producer, 0, NULL, NULL );
}
for ( ; atts != NULL && *atts != NULL; atts += 2 )
{
- mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (char*) atts[0], atts[1] == NULL ? "" : (char*) atts[1] );
+ mlt_properties_set( MLT_SERVICE_PROPERTIES( service ), (const char*) atts[0], atts[1] == NULL ? "" : (const char*) atts[1] );
// Look for the producer attribute
if ( xmlStrcmp( atts[ 0 ], _x("producer") ) == 0 )
{
- mlt_producer producer = mlt_properties_get_data( context->producer_map, (char*) atts[1], NULL );
+ mlt_producer producer = mlt_properties_get_data( context->producer_map, (const char*) atts[1], NULL );
if ( producer != NULL )
mlt_properties_set_data( MLT_SERVICE_PROPERTIES( service ), "producer", producer, 0, NULL, NULL );
}
// Set the properties
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( properties, (char*) atts[0], (char*) atts[1] );
+ mlt_properties_set( properties, (const char*) atts[0], (const char*) atts[1] );
}
static void on_end_filter( deserialise_context context, const xmlChar *name )
// Set the properties
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( properties, (char*) atts[0], (char*) atts[1] );
+ mlt_properties_set( properties, (const char*) atts[0], (const char*) atts[1] );
}
static void on_end_transition( deserialise_context context, const xmlChar *name )
enum service_type type;
mlt_service service = context_pop_service( context, &type );
mlt_properties properties = MLT_SERVICE_PROPERTIES( service );
- char *value = NULL;
+ const char *value = NULL;
if ( service != NULL )
{
}
else
{
- fprintf( stderr, "Property without a service '%s'?\n", ( char * )name );
+ fprintf( stderr, "Property without a service '%s'?\n", ( const char * )name );
}
}
}
else
{
- fprintf( stderr, "Property without a service '%s'??\n", (char *)name );
+ fprintf( stderr, "Property without a service '%s'??\n", (const char *)name );
}
}
on_start_property( context, name, atts );
else if ( xmlStrcmp( name, _x("westley") ) == 0 )
for ( ; atts != NULL && *atts != NULL; atts += 2 )
- mlt_properties_set( context->producer_map, ( char * )atts[ 0 ], ( char * )atts[ 1 ] );
+ mlt_properties_set( context->producer_map, ( const char * )atts[ 0 ], ( const char * )atts[ 1 ] );
}
static void on_end_element( void *ctx, const xmlChar *name )
return 0;
}
-char *deinterlace_methods[] = {
+const char *deinterlace_methods[] = {
"none",
"bob",
"weave",
#define DEINTERLACE_ONEFIELDXV 5
#define DEINTERLACE_LINEARBLEND 6
-extern char *deinterlace_methods[];
+extern const char *deinterlace_methods[];
#endif
#ifdef HAVE_STRPBRK
#define xine_strpbrk strpbrk
#else
-static inline char *_private_strpbrk(const char *s, const char *accept) {
+static inline const char *_private_strpbrk(const char *s, const char *accept) {
while(*s != '\0') {
const char *a = accept;
while(*a != '\0')
if(*a++ == *s)
- return(char *) s;
+ return s;
++s;
}
/** Execute a command.
*/
-valerie_error_code valerie_execute( valerie this, size_t size, char *format, ... )
+valerie_error_code valerie_execute( valerie this, size_t size, const char *format, ... )
{
valerie_error_code error = valerie_server_unavailable;
char *command = malloc( size );
/** Execute a command.
*/
-valerie_error_code valerie_receive( valerie this, char *doc, size_t size, char *format, ... )
+valerie_error_code valerie_receive( valerie this, char *doc, size_t size, const char *format, ... )
{
valerie_error_code error = valerie_server_unavailable;
char *command = malloc( size );
/** Execute a command.
*/
-valerie_error_code valerie_push( valerie this, mlt_service service, size_t size, char *format, ... )
+valerie_error_code valerie_push( valerie this, mlt_service service, size_t size, const char *format, ... )
{
valerie_error_code error = valerie_server_unavailable;
char *command = malloc( size );
/** Set a unit configuration property.
*/
-valerie_error_code valerie_unit_set( valerie this, int unit, char *name, char *value )
+valerie_error_code valerie_unit_set( valerie this, int unit, const char *name, const char *value )
{
return valerie_execute( this, 1024, "USET U%d %s=%s", unit, name, value );
}
/** List the contents of the specified directory.
*/
-valerie_dir valerie_dir_init( valerie this, char *directory )
+valerie_dir valerie_dir_init( valerie this, const char *directory )
{
valerie_dir dir = malloc( sizeof( valerie_dir_t ) );
if ( dir != NULL )
/** Obtain a printable message associated to the error code provided.
*/
-char *valerie_error_description( valerie_error_code error )
+const char *valerie_error_description( valerie_error_code error )
{
- char *msg = "Unrecognised error";
+ const char *msg = "Unrecognised error";
switch( error )
{
case valerie_ok:
extern valerie_error_code valerie_unit_clear_in( valerie, int );
extern valerie_error_code valerie_unit_clear_out( valerie, int );
extern valerie_error_code valerie_unit_clear_in_out( valerie, int );
-extern valerie_error_code valerie_unit_set( valerie, int, char *, char * );
+extern valerie_error_code valerie_unit_set( valerie, int, const char *, const char * );
extern valerie_error_code valerie_unit_get( valerie, int, char * );
extern valerie_error_code valerie_unit_status( valerie, int, valerie_status );
extern valerie_error_code valerie_unit_transfer( valerie, int, int );
*valerie_dir_entry, valerie_dir_entry_t;
/* Directory reading. */
-extern valerie_dir valerie_dir_init( valerie, char * );
+extern valerie_dir valerie_dir_init( valerie, const char * );
extern valerie_error_code valerie_dir_get_error_code( valerie_dir );
extern valerie_error_code valerie_dir_get( valerie_dir, int, valerie_dir_entry );
extern int valerie_dir_count( valerie_dir );
/* Miscellaenous functions */
extern valerie_response valerie_get_last_response( valerie );
-extern char *valerie_error_description( valerie_error_code );
+extern const char *valerie_error_description( valerie_error_code );
/* Courtesy functions. */
-extern valerie_error_code valerie_execute( valerie, size_t, char *, ... );
-extern valerie_error_code valerie_push( valerie, mlt_service, size_t, char *, ... );
+extern valerie_error_code valerie_execute( valerie, size_t, const char *, ... );
+extern valerie_error_code valerie_push( valerie, mlt_service, size_t, const char *, ... );
/* Close function. */
extern void valerie_close( valerie );
/** Execute a formatted command via the parser.
*/
-valerie_response valerie_parser_executef( valerie_parser parser, char *format, ... )
+valerie_response valerie_parser_executef( valerie_parser parser, const char *format, ... )
{
char *command = malloc( 10240 );
valerie_response response = NULL;
extern valerie_response valerie_parser_push( valerie_parser, char *, mlt_service );
extern valerie_response valerie_parser_received( valerie_parser, char *, char * );
extern valerie_response valerie_parser_execute( valerie_parser, char * );
-extern valerie_response valerie_parser_executef( valerie_parser, char *, ... );
+extern valerie_response valerie_parser_executef( valerie_parser, const char *, ... );
extern valerie_response valerie_parser_run( valerie_parser, char * );
extern valerie_notifier valerie_parser_get_notifier( valerie_parser );
extern void valerie_parser_close( valerie_parser );
/** Get the error description associated to the response.
*/
-char *valerie_response_get_error_string( valerie_response response )
+const char *valerie_response_get_error_string( valerie_response response )
{
- char *error_string = "No message specified";
+ const char *error_string = "No message specified";
if ( response->count > 0 )
{
char *ptr = strchr( response->array[ 0 ], ' ' ) ;
/** Set the error and description associated to the response.
*/
-void valerie_response_set_error( valerie_response response, int error_code, char *error_string )
+void valerie_response_set_error( valerie_response response, int error_code, const char *error_string )
{
if ( response->count == 0 )
{
/** Write formatted text to the response.
*/
-int valerie_response_printf( valerie_response response, size_t size, char *format, ... )
+int valerie_response_printf( valerie_response response, size_t size, const char *format, ... )
{
int length = 0;
char *text = malloc( size );
/** Write text to the reponse.
*/
-int valerie_response_write( valerie_response response, char *text, int size )
+int valerie_response_write( valerie_response response, const char *text, int size )
{
int ret = 0;
- char *ptr = text;
+ const char *ptr = text;
while ( size > 0 )
{
int index = response->count - 1;
- char *lf = strchr( ptr, '\n' );
+ const char *lf = strchr( ptr, '\n' );
int length_of_string = 0;
/* Make sure we have space in the dynamic array. */
extern valerie_response valerie_response_init( );
extern valerie_response valerie_response_clone( valerie_response );
extern int valerie_response_get_error_code( valerie_response );
-extern char *valerie_response_get_error_string( valerie_response );
+extern const char *valerie_response_get_error_string( valerie_response );
extern char *valerie_response_get_line( valerie_response, int );
extern int valerie_response_count( valerie_response );
-extern void valerie_response_set_error( valerie_response, int, char * );
-extern int valerie_response_printf( valerie_response, size_t, char *, ... );
-extern int valerie_response_write( valerie_response, char *, int );
+extern void valerie_response_set_error( valerie_response, int, const char * );
+extern int valerie_response_printf( valerie_response, size_t, const char *, ... );
+extern int valerie_response_write( valerie_response, const char *, int );
extern void valerie_response_close( valerie_response );
#ifdef __cplusplus
/** Write an arbitrarily formatted block of data to the server.
*/
-int valerie_socket_write_data( valerie_socket socket, char *data, int length )
+int valerie_socket_write_data( valerie_socket socket, const char *data, int length )
{
int used = 0;
extern int valerie_socket_connect( valerie_socket );
extern valerie_socket valerie_socket_init_fd( int );
extern int valerie_socket_read_data( valerie_socket, char *, int );
-extern int valerie_socket_write_data( valerie_socket, char *, int );
+extern int valerie_socket_write_data( valerie_socket, const char *, int );
extern void valerie_socket_close( valerie_socket );
#ifdef __cplusplus
char *valerie_status_serialise( valerie_status status, char *text, int length )
{
- char *status_string = NULL;
+ const char *status_string = NULL;
switch( status->status )
{
/** Parse a string by splitting on the delimiter provided.
*/
-int valerie_tokeniser_parse_new( valerie_tokeniser tokeniser, char *string, char *delimiter )
+int valerie_tokeniser_parse_new( valerie_tokeniser tokeniser, char *string, const char *delimiter )
{
int count = 0;
int length = strlen( string );
*/
extern valerie_tokeniser valerie_tokeniser_init( );
-extern int valerie_tokeniser_parse_new( valerie_tokeniser, char *, char * );
+extern int valerie_tokeniser_parse_new( valerie_tokeniser, char *, const char * );
extern char *valerie_tokeniser_get_input( valerie_tokeniser );
extern int valerie_tokeniser_count( valerie_tokeniser );
extern char *valerie_tokeniser_get_string( valerie_tokeniser, int );