#if defined(LINUX)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
using namespace UT::Literal;
namespace HDK_Sample {
template <VEX_Precision PREC>
static void
pid_Evaluate(int, void *argv[], void *)
{
*result = getpid();
}
template <VEX_Precision PREC>
static void
tid_Evaluate(int, void *argv[], void *)
{
}
template <VEX_Precision PREC>
static void
printStuff(int, void *argv[], void *)
{
static int callCount = 0;
fprintf(stderr,
"Still here %d\n", callCount++);
result[0] = 0;
}
static void *
initFunc()
{
return 0;
}
static void
{
fprintf(stderr,
"Cleanup: Data = %p\n", data);
}
}
using namespace HDK_Sample;
void
{
new VEX_VexOp(
"getpid@&I"_sh, pid_Evaluate<VEX_32>,
new VEX_VexOp(
"gettid@&I"_sh, tid_Evaluate<VEX_32>,
new VEX_VexOp(
"sticky@&I"_sh, printStuff<VEX_32>,
new VEX_VexOp(
"rcode@&I*F*FFF"_sh, printStuff<VEX_32>,
new VEX_VexOp(
"rcode@&I*F*FS"_sh, printStuff<VEX_32>,
}
#endif