42 static void _dsdb_destroy_ds_conf(
DSConf *ds_conf)
45 if (ds_conf->
site) free((
void *)ds_conf->
site);
47 if (ds_conf->
name) free((
void *)ds_conf->
name);
48 if (ds_conf->
level) free((
void *)ds_conf->
level);
49 if (ds_conf->
key) free((
void *)ds_conf->
key);
50 if (ds_conf->
value) free((
void *)ds_conf->
value);
55 static DSConf *_dsdb_create_ds_conf(
72 ds_conf->
site = msngr_copy_string(site);
79 ds_conf->
site = (
char *)NULL;
85 ds_conf->
facility = msngr_copy_string(facility);
87 _dsdb_destroy_ds_conf(ds_conf);
98 ds_conf->
name = msngr_copy_string(name);
100 _dsdb_destroy_ds_conf(ds_conf);
105 ds_conf->
name = (
char *)NULL;
111 ds_conf->
level = msngr_copy_string(level);
112 if (!ds_conf->
level) {
113 _dsdb_destroy_ds_conf(ds_conf);
118 ds_conf->
level = (
char *)NULL;
124 ds_conf->
key = msngr_copy_string(key);
126 _dsdb_destroy_ds_conf(ds_conf);
131 ds_conf->
key = (
char *)NULL;
137 ds_conf->
value = msngr_copy_string(value);
138 if (!ds_conf->
value) {
139 _dsdb_destroy_ds_conf(ds_conf);
144 ds_conf->
value = (
char *)NULL;
165 for (row = 0; ds_conf[row]; row++) {
166 _dsdb_destroy_ds_conf(ds_conf[row]);
209 const char *facility,
211 const char *ds_level,
219 *ds_conf = (
DSConf **)NULL;
221 status = dsdbog_get_datastream_config_values(
222 dsdb->
dbconn, ds_name, ds_level, site, facility, key, &dbres);
230 "Could not get datastream config values\n"
231 " -> memory allocation error\n");
237 for (row = 0; row < dbres->
nrows; row++) {
239 (*ds_conf)[row] = _dsdb_create_ds_conf(
240 DSConfName(dbres,row),
241 DSConfLevel(dbres,row),
242 DSConfSite(dbres,row),
243 DSConfFac(dbres,row),
244 DSConfKey(dbres,row),
245 DSConfValue(dbres,row));
247 if (!(*ds_conf)[row]) {
250 "Could not get datastream config values\n"
251 " -> memory allocation error\n");
254 *ds_conf = (
DSConf **)NULL;