r5496: def-foreign-var support
[uffi.git] / tests / uffi-c-test-lib.c
index d8e9b49aa152a4782fa361f2413b47ba3cd294f6..99b9004f956342444965ddcd865194f1dae86db0 100644 (file)
@@ -6,7 +6,7 @@
  *  Programer:    Kevin M. Rosenberg
  *  Date Started: Mar 2002
  *
- *  CVS Id:   $Id: uffi-c-test-lib.c,v 1.1 2003/04/29 14:08:02 kevin Exp $
+ *  CVS Id:   $Id: uffi-c-test-lib.c,v 1.3 2003/08/14 21:40:13 kevin Exp $
  *
  * This file, part of UFFI, is Copyright (c) 2002 by Kevin M. Rosenberg
  *
@@ -39,6 +39,15 @@ BOOL WINAPI DllEntryPoint(HINSTANCE hinstdll,
 #include <math.h>
 
 
+DLLEXPORT unsigned char uchar_13 = 13;
+DLLEXPORT signed char schar_neg_120 = -120;
+DLLEXPORT unsigned short uword_257 = 257;
+DLLEXPORT signed short sword_neg_321 = -321;
+DLLEXPORT unsigned int uint_1234567 = 1234567;
+DLLEXPORT signed int sint_neg_123456 = -123456;
+DLLEXPORT double double_3_1 = 3.1;
+DLLEXPORT float float_neg_4_5 = -4.5;
+
 /* Test of constant input string */
 DLLEXPORT
 int
@@ -93,3 +102,19 @@ half_double_vector (int size, double* vec)
 
     
 
+DLLEXPORT
+void *
+cast_test_int () {
+  int *x = (int *) malloc(sizeof(int));
+  *x = 23;
+  return x;
+}
+
+DLLEXPORT
+void *
+cast_test_float ()
+{
+  double *y = (double *) malloc(sizeof(double));
+  *y = 3.21;
+  return y;
+}