Changeset d17cf8c in mainline for uspace/app/hbench/env.c
- Timestamp:
- 2019-01-21T13:39:37Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 94d52d5
- Parents:
- e7f9a09
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/hbench/env.c
re7f9a09 rd17cf8c 34 34 */ 35 35 36 #include <adt/hash_table.h>37 36 #include <stdlib.h> 38 37 #include <stdio.h> … … 90 89 }; 91 90 92 /** Table of extra parameters (of param_t). */ 93 static hash_table_t param_hash_table; 94 95 extern errno_t bench_param_init(void) 91 extern errno_t bench_env_init(bench_env_t *env) 96 92 { 97 bool ok = hash_table_create(& param_hash_table, 0, 0, ¶m_hash_table_ops);93 bool ok = hash_table_create(&env->parameters, 0, 0, ¶m_hash_table_ops); 98 94 if (!ok) { 99 95 return ENOMEM; … … 103 99 } 104 100 105 extern void bench_ param_cleanup(void)101 extern void bench_env_cleanup(bench_env_t *env) 106 102 { 107 hash_table_destroy(& param_hash_table);103 hash_table_destroy(&env->parameters); 108 104 } 109 105 110 errno_t bench_ param_set(const char *key, const char *value)106 errno_t bench_env_param_set(bench_env_t *env, const char *key, const char *value) 111 107 { 112 108 param_t *param = malloc(sizeof(param_t)); … … 126 122 } 127 123 128 hash_table_insert(& param_hash_table, ¶m->link);124 hash_table_insert(&env->parameters, ¶m->link); 129 125 130 126 return EOK; 131 127 } 132 128 133 const char *bench_ param_get(const char *key, const char *default_value)129 const char *bench_env_param_get(bench_env_t *env, const char *key, const char *default_value) 134 130 { 135 ht_link_t *item = hash_table_find(& param_hash_table, (char *) key);131 ht_link_t *item = hash_table_find(&env->parameters, (char *) key); 136 132 137 133 if (item == NULL) {
Note:
See TracChangeset
for help on using the changeset viewer.