Lhogho  0.0.028
 All Data Structures Files Functions Variables Typedefs Macros Pages
testlib.c
Go to the documentation of this file.
1 #define LIB_DLL_EXPORT 1
2 #include "testlib.h"
3 
4 void initialize_lib();
5 
6 #if defined(WINDOWS)
7 #include "windows.h"
8 BOOL WINAPI DllMain(
9  HINSTANCE hinstDLL, // handle to DLL module
10  DWORD fdwReason, // reason for calling function
11  LPVOID lpReserved ) // reserved
12 {
13  switch( fdwReason )
14  {
15  case DLL_PROCESS_ATTACH:
16  case DLL_THREAD_ATTACH:
18  break;
19  case DLL_THREAD_DETACH:
20  case DLL_PROCESS_DETACH:
21  break;
22  }
23  return TRUE;
24 }
25 #else
26 #pragma CALL_ON_LOAD initialize_lib
27 #endif
28 
29 
30 
31 LIB_API
33 {
34  // code to initialize the library (if needed)
35 }
36 
37 LIB_API unsigned char addub( unsigned char x, unsigned char y )
38 {
39  return x+y;
40 }
41 
42 LIB_API unsigned short addus( unsigned short x, unsigned short y )
43 {
44  return x+y;
45 }
46 
47 LIB_API unsigned int adduw( unsigned int x, unsigned int y )
48 {
49  return x+y;
50 }
51 
52 LIB_API uint64_t addud( uint64_t x, uint64_t y )
53 {
54  return x+y;
55 }
56 
57 LIB_API char addib( char x, char y )
58 {
59  return x+y;
60 }
61 
62 LIB_API short addis( short x, short y )
63 {
64  return x+y;
65 }
66 
67 LIB_API int addiw( int x, int y )
68 {
69  return x+y;
70 }
71 
72 LIB_API int64_t addid( int64_t x, int64_t y )
73 {
74  return x+y;
75 }
76 
77 LIB_API int apply( fn_t function, int x, int y )
78 {
79  return function(x,y);
80 }
81 
82 LIB_API int asciichar( char* s )
83 {
84  return *s;
85 }

[ HOME | INDEX | ATOMS | VARS | REFERENCE ]
Lhogho Developer's Documentation
Wed Jul 10 2013