#ifndef __SYSTEMUTIL_H__
#define __SYSTEMUTIL_H__

#ifdef __cplusplus
#ifndef BEGIN_DECLS
#define BEGIN_DECLS extern "C" {
#endif
#ifndef END_DECLS
#define END_DECLS }
#endif
#else
#ifndef BEGIN_DECLS
#define BEGIN_DECLS
#endif
#ifndef END_DECLS
#define END_DECLS
#endif
#endif

BEGIN_DECLS

#if defined(_WIN32) && defined(UNICODE)
#include <wchar.h>
#include <Rpcdce.h>
#endif

#include <stdio.h>
#include <unistd.h>
#include <libgen.h>
#include <stdlib.h>
#include <limits.h>
#include <time.h>


#include "SecureCodingUtil.h"
#include "Common.h"
#ifdef _WIN32
#include <windows.h>
#include <sys/stat.h>
#endif

#define SYS_ERR_SUCCESS         0
#define SYS_ERR_UUID_FORMAT     -1

#ifdef _WIN32
typedef GUID uuid_t;
#endif

void GetExecPath (char *szAbsolutePath,size_t nBufferSize, const char *szMainArgument0);
long TimeDiff(struct tm *pStartTM, int nStartMilliSeconds, struct tm *pEndTM, int nEndMilliSeconds);
#ifdef _WIN32
void uuid_generate(uuid_t *pUUID);
int uuid_parse(const char *in, uuid_t *pUUID);
void uuid_unparse(uuid_t *pUUID, char *pUUIDString);
char *realpath(const char *path, char resolved_path[PATH_MAX]);
void ASCIIToUTF8(char *pASCII, int nASCSize, char *pUTF8, int nUTF8Size);
void UTF8ToASCII(char *pUTF8, int nUTF8Size, char *pASCII, int nASCSize);
#endif

END_DECLS

#endif
