Flutter Engine
The Flutter Engine
Classes | Functions | Variables
ffi_native_test_module.c File Reference
#include <emscripten.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  MyStruct
 

Functions

EMSCRIPTEN_KEEPALIVE struct MyStructgetStruct ()
 
EMSCRIPTEN_KEEPALIVE void clearStruct (struct MyStruct *s)
 
EMSCRIPTEN_KEEPALIVE void empty ()
 
EMSCRIPTEN_KEEPALIVE int8_t addInt8 (int8_t a, int8_t b)
 
EMSCRIPTEN_KEEPALIVE uint8_t addUint8 (uint8_t a, uint8_t b)
 
EMSCRIPTEN_KEEPALIVE int16_t addInt16 (int16_t a, int16_t b)
 
EMSCRIPTEN_KEEPALIVE uint16_t addUint16 (uint16_t a, uint16_t b)
 
EMSCRIPTEN_KEEPALIVE int32_t addInt32 (int32_t a, int32_t b)
 
EMSCRIPTEN_KEEPALIVE uint32_t addUint32 (uint32_t a, uint32_t b)
 
EMSCRIPTEN_KEEPALIVE int64_t addInt64 (int64_t a, int64_t b)
 
EMSCRIPTEN_KEEPALIVE uint64_t addUint64 (uint64_t a, uint64_t b)
 
EMSCRIPTEN_KEEPALIVE bool negateBool (bool a)
 
EMSCRIPTEN_KEEPALIVE void toggleBool ()
 
EMSCRIPTEN_KEEPALIVE bool boolReturn (int a)
 
EMSCRIPTEN_KEEPALIVE char incrementChar (char a)
 
EMSCRIPTEN_KEEPALIVE unsigned char incrementUnsignedChar (unsigned char a)
 
EMSCRIPTEN_KEEPALIVE signed char incrementSignedChar (signed char a)
 
EMSCRIPTEN_KEEPALIVE short incrementShort (short a)
 
EMSCRIPTEN_KEEPALIVE unsigned short incrementUnsignedShort (unsigned short a)
 
EMSCRIPTEN_KEEPALIVE int incrementInt (int a)
 
EMSCRIPTEN_KEEPALIVE unsigned int incrementUnsignedInt (unsigned int a)
 
EMSCRIPTEN_KEEPALIVE long incrementLong (long a)
 
EMSCRIPTEN_KEEPALIVE unsigned long incrementUnsignedLong (unsigned long a)
 
EMSCRIPTEN_KEEPALIVE long long incrementLongLong (long long a)
 
EMSCRIPTEN_KEEPALIVE unsigned long long incrementUnsignedLongLong (unsigned long long a)
 
EMSCRIPTEN_KEEPALIVE intptr_t incrementIntPtr (intptr_t a)
 
EMSCRIPTEN_KEEPALIVE uintptr_t incrementUintPtr (uintptr_t a)
 
EMSCRIPTEN_KEEPALIVE size_t incrementSize (size_t a)
 
EMSCRIPTEN_KEEPALIVE wchar_t incrementWchar (wchar_t a)
 

Variables

struct MyStruct s = { 1.0, 2 }
 
struct MyStruct a [10] = { 1.0, 2 }
 
static bool b = true
 

Function Documentation

◆ addInt16()

EMSCRIPTEN_KEEPALIVE int16_t addInt16 ( int16_t  a,
int16_t  b 
)

Definition at line 40 of file ffi_native_test_module.c.

40 {
41 return a + b;
42}
static bool b
struct MyStruct a[10]

◆ addInt32()

EMSCRIPTEN_KEEPALIVE int32_t addInt32 ( int32_t  a,
int32_t  b 
)

Definition at line 50 of file ffi_native_test_module.c.

50 {
51 return a + b;
52}

◆ addInt64()

EMSCRIPTEN_KEEPALIVE int64_t addInt64 ( int64_t  a,
int64_t  b 
)

Definition at line 60 of file ffi_native_test_module.c.

60 {
61 return a + b;
62}

◆ addInt8()

EMSCRIPTEN_KEEPALIVE int8_t addInt8 ( int8_t  a,
int8_t  b 
)

Definition at line 30 of file ffi_native_test_module.c.

30 {
31 return a + b;
32}

◆ addUint16()

EMSCRIPTEN_KEEPALIVE uint16_t addUint16 ( uint16_t  a,
uint16_t  b 
)

Definition at line 45 of file ffi_native_test_module.c.

45 {
46 return a + b;
47}

◆ addUint32()

EMSCRIPTEN_KEEPALIVE uint32_t addUint32 ( uint32_t  a,
uint32_t  b 
)

Definition at line 55 of file ffi_native_test_module.c.

55 {
56 return a + b;
57}

◆ addUint64()

EMSCRIPTEN_KEEPALIVE uint64_t addUint64 ( uint64_t  a,
uint64_t  b 
)

Definition at line 65 of file ffi_native_test_module.c.

65 {
66 return a + b;
67}

◆ addUint8()

EMSCRIPTEN_KEEPALIVE uint8_t addUint8 ( uint8_t  a,
uint8_t  b 
)

Definition at line 35 of file ffi_native_test_module.c.

35 {
36 return a + b;
37}

◆ boolReturn()

EMSCRIPTEN_KEEPALIVE bool boolReturn ( int  a)

Definition at line 82 of file ffi_native_test_module.c.

82 {
83 if (a == 123) {
84 return true;
85 } else if (a == 456) {
86 return false;
87 } else {
88 return b;
89 }
90}

◆ clearStruct()

EMSCRIPTEN_KEEPALIVE void clearStruct ( struct MyStruct s)

Definition at line 21 of file ffi_native_test_module.c.

21 {
22 s->x = 0.0;
23 s->y = 0;
24}
struct MyStruct s

◆ empty()

EMSCRIPTEN_KEEPALIVE void empty ( )

Definition at line 27 of file ffi_native_test_module.c.

27{}

◆ getStruct()

EMSCRIPTEN_KEEPALIVE struct MyStruct * getStruct ( )

Definition at line 16 of file ffi_native_test_module.c.

16 {
17 return &s;
18}

◆ incrementChar()

EMSCRIPTEN_KEEPALIVE char incrementChar ( char  a)

Definition at line 93 of file ffi_native_test_module.c.

93 {
94 return a + 1;
95}

◆ incrementInt()

EMSCRIPTEN_KEEPALIVE int incrementInt ( int  a)

Definition at line 118 of file ffi_native_test_module.c.

118 {
119 return a + 1;
120}

◆ incrementIntPtr()

EMSCRIPTEN_KEEPALIVE intptr_t incrementIntPtr ( intptr_t  a)

Definition at line 148 of file ffi_native_test_module.c.

148 {
149 return a + 1;
150}

◆ incrementLong()

EMSCRIPTEN_KEEPALIVE long incrementLong ( long  a)

Definition at line 128 of file ffi_native_test_module.c.

128 {
129 return a + 1;
130}

◆ incrementLongLong()

EMSCRIPTEN_KEEPALIVE long long incrementLongLong ( long long  a)

Definition at line 138 of file ffi_native_test_module.c.

138 {
139 return a + 1;
140}

◆ incrementShort()

EMSCRIPTEN_KEEPALIVE short incrementShort ( short  a)

Definition at line 108 of file ffi_native_test_module.c.

108 {
109 return a + 1;
110}

◆ incrementSignedChar()

EMSCRIPTEN_KEEPALIVE signed char incrementSignedChar ( signed char  a)

Definition at line 103 of file ffi_native_test_module.c.

103 {
104 return a + 1;
105}

◆ incrementSize()

EMSCRIPTEN_KEEPALIVE size_t incrementSize ( size_t  a)

Definition at line 158 of file ffi_native_test_module.c.

158 {
159 return a + 1;
160}

◆ incrementUintPtr()

EMSCRIPTEN_KEEPALIVE uintptr_t incrementUintPtr ( uintptr_t  a)

Definition at line 153 of file ffi_native_test_module.c.

153 {
154 return a + 1;
155}

◆ incrementUnsignedChar()

EMSCRIPTEN_KEEPALIVE unsigned char incrementUnsignedChar ( unsigned char  a)

Definition at line 98 of file ffi_native_test_module.c.

98 {
99 return a + 1;
100}

◆ incrementUnsignedInt()

EMSCRIPTEN_KEEPALIVE unsigned int incrementUnsignedInt ( unsigned int  a)

Definition at line 123 of file ffi_native_test_module.c.

123 {
124 return a + 1;
125}

◆ incrementUnsignedLong()

EMSCRIPTEN_KEEPALIVE unsigned long incrementUnsignedLong ( unsigned long  a)

Definition at line 133 of file ffi_native_test_module.c.

133 {
134 return a + 1;
135}

◆ incrementUnsignedLongLong()

EMSCRIPTEN_KEEPALIVE unsigned long long incrementUnsignedLongLong ( unsigned long long  a)

Definition at line 143 of file ffi_native_test_module.c.

143 {
144 return a + 1;
145}

◆ incrementUnsignedShort()

EMSCRIPTEN_KEEPALIVE unsigned short incrementUnsignedShort ( unsigned short  a)

Definition at line 113 of file ffi_native_test_module.c.

113 {
114 return a + 1;
115}

◆ incrementWchar()

EMSCRIPTEN_KEEPALIVE wchar_t incrementWchar ( wchar_t  a)

Definition at line 163 of file ffi_native_test_module.c.

163 {
164 return a + 1;
165}

◆ negateBool()

EMSCRIPTEN_KEEPALIVE bool negateBool ( bool  a)

Definition at line 70 of file ffi_native_test_module.c.

70 {
71 return !a;
72}

◆ toggleBool()

EMSCRIPTEN_KEEPALIVE void toggleBool ( )

Definition at line 77 of file ffi_native_test_module.c.

77 {
78 b = !b;
79}

Variable Documentation

◆ a

struct MyStruct a[10] = { 1.0, 2 }

◆ b

bool b = true
static

Definition at line 74 of file ffi_native_test_module.c.

◆ s

struct MyStruct s = { 1.0, 2 }