#include <string.h>
#include <mariadb/mysql.h>

//  Check arguments
my_bool testudf_init(UDF_INIT* initid,UDF_ARGS* args,char* message)
{
   if (args->arg_count!=1 || args->arg_type[0]!=STRING_RESULT)
   {
      strcpy(message,"testudf takes one string arguments");
      return 1;
   }
   initid->maybe_null=0;
   initid->const_item=0;
   return 0;
}

//  Destructor
void testudf_deinit(UDF_INIT* initid)
{
}

//  Check if IP address is with Subnet
long long testudf(UDF_INIT* initid,UDF_ARGS* args,char* is_null,char* error)
{
   //  Never returns an error or null
   *is_null = 0;
   *error = 0;
   return args->lengths[0];
}
