/**
 * \file Utils.h
 * \brief Different helper functions for NWd.
 * \author Dmytro Podgornyi (d.podgornyi@samsung.com)
 * \version 0.1
 * \date Created May 28, 2013
 * \par In Samsung Ukraine R&D Center (SURC) under a contract between
 * \par LLC "Samsung Electronics Ukraine Company" (Kiev, Ukraine) and
 * \par "Samsung Elecrtronics Co", Ltd (Seoul, Republic of Korea)
 * \par Copyright: (c) Samsung Electronics Co, Ltd 2012. All rights reserved.
 */

#ifndef __UTILS_H_INCLUDED__
#define __UTILS_H_INCLUDED__

#include <stdint.h>
#include <stdio.h>
#include "CommLayerData.h"

int getTime(struct KeyInfo *info);
int getModel(uint8_t *model, uint32_t modelLen);
int getSerialNo(uint8_t *serial, uint32_t serialLen);

int createDirsForFile(const char *path);
/* return value of fileSize functions is size_t (unsigned) for backward
 * compatibility with old code that uses uint32_t for size. In case of an
 * error they return 0 */
size_t ffileSize(FILE *f);
size_t fileSize(const char *path);
size_t readFile(const char *path, uint8_t *buf, uint32_t size);
int delDirFile(const char* folder);
int chmod644(const char *path);
int mkdirWrapper(const char *path, mode_t mode);
int ownerSetSystem(const char *path);
int hasSystemPermissions(void);

#endif /* __UTILS_H_INCLUDED__ */
