#include "MMD_AgentDammiy.h"

#include <string.h>
#include <malloc.h>

/* MMDFiles_strdup: strdup */
char *MMDAgent_pathdup(const char *str)
{
   char *buf;

   if(str == NULL)
      return NULL;
   buf = (char *) malloc(sizeof(char) * (strlen(str) + 1));
   strcpy(buf, str);

   return buf;
}


char *MMDAgent_strdup(const char *str)
{
   char *buf;

   if(str == NULL)
      return NULL;
   buf = (char *) malloc(sizeof(char) * (strlen(str) + 1));
   strcpy(buf, str);

   return buf;
}


int MMDAgent_strlen(const char *str)
{
   if(str == NULL)
      return 0;
   else
      return strlen(str);
}
