|
@@ -1316,41 +1316,6 @@ int setting_name ( struct settings *settings, struct setting *setting,
|
1316
|
1316
|
setting->name, setting->type->name );
|
1317
|
1317
|
}
|
1318
|
1318
|
|
1319
|
|
-/**
|
1320
|
|
- * Store value of named setting
|
1321
|
|
- *
|
1322
|
|
- * @v name Name of setting
|
1323
|
|
- * @v default_type Default type to use, if none specified
|
1324
|
|
- * @v data Setting data, or NULL to clear setting
|
1325
|
|
- * @v len Length of setting data
|
1326
|
|
- * @ret rc Return status code
|
1327
|
|
- */
|
1328
|
|
-int store_named_setting ( const char *name, struct setting_type *default_type,
|
1329
|
|
- const void *data, size_t len ) {
|
1330
|
|
- struct settings *settings;
|
1331
|
|
- struct setting setting;
|
1332
|
|
- char tmp_name[ strlen ( name ) + 1 ];
|
1333
|
|
- int rc;
|
1334
|
|
-
|
1335
|
|
- /* Create modifiable copy of setting name */
|
1336
|
|
- strcpy ( tmp_name, name );
|
1337
|
|
-
|
1338
|
|
- /* Parse setting name */
|
1339
|
|
- if ( ( rc = parse_setting_name ( tmp_name, autovivify_child_settings,
|
1340
|
|
- &settings, &setting ) ) != 0 )
|
1341
|
|
- return rc;
|
1342
|
|
-
|
1343
|
|
- /* Apply default type if necessary */
|
1344
|
|
- if ( ! setting.type )
|
1345
|
|
- setting.type = default_type;
|
1346
|
|
-
|
1347
|
|
- /* Store setting */
|
1348
|
|
- if ( ( rc = store_setting ( settings, &setting, data, len ) ) != 0 )
|
1349
|
|
- return rc;
|
1350
|
|
-
|
1351
|
|
- return 0;
|
1352
|
|
-}
|
1353
|
|
-
|
1354
|
1319
|
/**
|
1355
|
1320
|
* Parse and store value of named setting
|
1356
|
1321
|
*
|