summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c
index fb44240..b717a99 100644
--- a/lib/utils_base.c
+++ b/lib/utils_base.c
@@ -321,6 +321,10 @@ char *np_state_generate_key(char **argv) {
321 return "Ahash"; 321 return "Ahash";
322} 322}
323 323
324char* _np_state_calculate_location_prefix(){
325 return NP_SHAREDSTATE_DIR;
326}
327
324/* 328/*
325 * Initiatializer for state routines. 329 * Initiatializer for state routines.
326 * Sets variables. Generates filename. Returns np_state_key. die with 330 * Sets variables. Generates filename. Returns np_state_key. die with
@@ -328,6 +332,7 @@ char *np_state_generate_key(char **argv) {
328 */ 332 */
329state_key *np_state_init(char *plugin_name, char *keyname, int expected_data_version) { 333state_key *np_state_init(char *plugin_name, char *keyname, int expected_data_version) {
330 state_key *this_state = NULL; 334 state_key *this_state = NULL;
335 char *temp_filename = NULL;
331 336
332 this_state = (state_key *) malloc(sizeof(state_key)); 337 this_state = (state_key *) malloc(sizeof(state_key));
333 338
@@ -339,7 +344,8 @@ state_key *np_state_init(char *plugin_name, char *keyname, int expected_data_ver
339 this_state->data_version=expected_data_version; 344 this_state->data_version=expected_data_version;
340 345
341 /* Calculate filename */ 346 /* Calculate filename */
342 this_state->_filename="Tobedone"; 347 asprintf(&temp_filename, "%s/%s", _np_state_calculate_location_prefix(), plugin_name);
348 this_state->_filename=temp_filename;
343 349
344 return this_state; 350 return this_state;
345} 351}