#ifndef GFD_FIXEDSIZE_MEMORY_H_
#define GFD_FIXEDSIZE_MEMORY_H_

#include <string.h>

#ifdef __cplusplus
extern "C" {
#endif

static __inline void gfd_memzero32(void* const dst, unsigned int size)
{
  memset(dst, 0, size);
}

static __inline void gfd_memset32(void* const dst, int val, unsigned int size)
{
  memset(dst, val, size);
}

static __inline void gfd_memcpy_opt32(void *const dst, const void* const src, unsigned int size)
{
  memcpy(dst, src, size);
}

static __inline int gfd_strnlen(const char *str, int maxCount)
{
  if (!str)
	  return 0;
  //-- non standard! return strnlen(str, maxCount);
  {
      int i = 0;
      for(; (i < maxCount) && str[i]; ++i)
      {
    	  //empty body
      }
      return i;
  }
}

static __inline char *gfd_strncpy(char *dest, const char *source, int count)
{
  return strncpy(dest, source, count);
}

#ifdef __cplusplus
}
#endif

#endif /*GFD_FIXEDSIZE_MEMORY_H_*/
