]> git.sesse.net Git - mlt/commitdiff
Add LC_NUMERIC handling to YAML Tiny parser.
authorDan Dennedy <dan@dennedy.org>
Sat, 9 Jul 2011 20:03:30 +0000 (13:03 -0700)
committerDan Dennedy <dan@dennedy.org>
Sat, 9 Jul 2011 20:03:30 +0000 (13:03 -0700)
src/framework/metaschema.yaml
src/framework/mlt_properties.c

index 9c7c78f3beb5ddf69b5350ac67598c1da7e3dbeb..6675f4aca11a1804256796d32f920d9c81d5759b 100644 (file)
@@ -5,6 +5,9 @@ mapping:
   "schema_version": # This should match the version comment above
     type: float
     required: yes
+  "LC_NUMERIC": # If not provided LC_NUMERIC=C is used, not the system's locale.
+    type: str
+    required: no
   "type": # A service type
     type: str
     required: yes
index f12a8c6f5043652ac281ef502577c96610ce48a3..8bab269b81f34a03923b0ecca8da914abc6e8ac2 100644 (file)
@@ -1468,6 +1468,7 @@ static int parse_yaml( yaml_parser context, const char *namevalue )
                if ( strcmp( ptr, "" ) == 0 )
                {
                        mlt_properties child = mlt_properties_new();
+                       mlt_properties_set_lcnumeric( child, mlt_properties_get_lcnumeric( properties ) );
                        mlt_properties_set_data( properties, name, child, 0,
                                ( mlt_destructor )mlt_properties_close, NULL );
                        mlt_deque_push_front( context->stack, child );
@@ -1482,6 +1483,7 @@ static int parse_yaml( yaml_parser context, const char *namevalue )
                        mlt_properties child = mlt_properties_new();
                        char key[20];
 
+                       mlt_properties_set_lcnumeric( child, mlt_properties_get_lcnumeric( properties ) );
                        snprintf( key, sizeof(key), "%d", context->index++ );
                        mlt_properties_set_data( properties, key, child, 0,
                                ( mlt_destructor )mlt_properties_close, NULL );
@@ -1620,6 +1622,9 @@ static int parse_yaml( yaml_parser context, const char *namevalue )
 
        error = mlt_properties_set( properties, name, value );
 
+       if ( !strcmp( name, "LC_NUMERIC" ) )
+               mlt_properties_set_lcnumeric( properties, value );
+
        free( name_ );
        free( value );
 
@@ -1650,6 +1655,9 @@ mlt_properties mlt_properties_parse_yaml( const char *filename )
                        char temp[ 1024 ];
                        char *ptemp = &temp[ 0 ];
 
+                       // Default to LC_NUMERIC = C
+                       mlt_properties_set_lcnumeric( self, "C" );
+
                        // Parser context
                        yaml_parser context = calloc( 1, sizeof( struct yaml_parser_context ) );
                        context->stack = mlt_deque_init();