/*- Author: Brian Tiffin Dedicated to the public domain Date started: December 2016 Modified: 2016-12-30/01:54-0500 +*/ /* testnative.c, testing an experimental Unicon native call layer */ #include int testnative(int one, int two) { int ivalue; fprintf(stderr, "In testnative %d %d\n", one, two); fflush(stderr); ivalue = one + two; return ivalue; } double testdouble(double one, double two) { fprintf(stderr, "In testdouble %f %f\n", one, two); fflush(stderr); return one + two; } double testfive(double one, double two, int three, double four, double five) { double sum; fprintf(stderr, "In testfive %f %f %d %f %f\n", one, two, three, four, five); fflush(stderr); sum = one + two + three + four + five; return sum; } void * teststar() { fprintf(stderr, "In teststar\n"); fflush(stderr); return &teststar; } char * teststring(char *echo) { fprintf(stderr, "In teststring with #%s#\n", echo); fflush(stderr); return echo; } char * testmulti(char *echo, int i, double d) { fprintf(stderr, "In testmulti with #%s# %d %f\n", echo, i, d); fflush(stderr); return echo; } double testmultid(char *echo, int i, double d) { fprintf(stderr, "In testmultid with #%s# %d %f\n", echo, i, d); fflush(stderr); return d; } /* Requires using nativeFloat from Unicon */ float testfloat(float one, float two) { fprintf(stderr, "In testfloat %f %f\n", one, two); fflush(stderr); return one + two; } float testmultif(char *echo, int i, float f) { fprintf(stderr, "In testmultif with #%s# %d %f\n", echo, i, f); fflush(stderr); return f; }