/*
 * diot_util - diagnostic tool for DIOT system board
 * 
 * Author: Adam Wujek for CERN
 * Copyright CERN 2021
 * 
 */

#ifndef __UTIL_H
#define __UTIL_H
#include <time.h>

struct string_map {
    char *index;
    char *label;
};

time_t get_monotonic_sec(void);
char *get_file_content(char *filename, char *buff, size_t buff_size);
int get_file_content_int(char *file_name, int *val);
int set_file_content_int(char *file_name, int val);
char *end_str_at_newline(char *buff);
char *get_hwmon_number(char *hwmon_sys_dir, char * buff, size_t buff_size);


char *string_map_get(char *name, struct string_map *map, size_t map_size);

#endif /* __UTIL_H */
