28 lines
836 B
C
Raw Normal View History

2022-04-16 00:02:41 +08:00
#include "ctypes_Test.h"
2022-04-16 11:38:47 +08:00
#include "ctypes_c_uint.h"
#include "ctypes_c_wchar_p.h"
#include "ctypes_utils.h"
2022-04-16 11:38:47 +08:00
void ctypes_c_uint___init__(PikaObj* self, int value) {
2022-04-17 22:56:21 +08:00
ctypesUtils_setInt(self, value);
2022-04-16 00:02:41 +08:00
}
2022-04-16 11:38:47 +08:00
void ctypes_c_wchar_p___init__(PikaObj* self, char* value) {
2022-04-17 22:56:21 +08:00
ctypesUtils_setStr(self, value);
2022-04-16 00:02:41 +08:00
}
int ctypes_Test_add(PikaObj* self, PikaObj* c_uint1, PikaObj* c_uint2) {
2022-04-17 22:56:21 +08:00
return ctypesUtils_getInt(c_uint1) + ctypesUtils_getInt(c_uint2);
}
int ctypes_Test_dc_cpuapdu_hex(PikaObj* self,
PikaObj* rcvbuf,
PikaObj* rlen,
char* sendbuf,
int slen) {
printf("input: slen = %d, sendbuf = %s\n", slen, sendbuf);
ctypesUtils_setInt(rlen, 5);
ctypesUtils_setStr(rcvbuf, "testout");
return 0;
2022-04-16 00:02:41 +08:00
}