diff --git a/examples/pikapython/CMakeLists.txt b/examples/pikapython/CMakeLists.txt index 4d9d6f34..53f0fc98 100644 --- a/examples/pikapython/CMakeLists.txt +++ b/examples/pikapython/CMakeLists.txt @@ -5,8 +5,9 @@ include(proj.conf) find_package(bouffalo_sdk REQUIRED HINTS $ENV{BL_SDK_BASE}) file(GLOB_RECURSE sources "${CMAKE_CURRENT_SOURCE_DIR}/pikapython/*.c") +file(GLOB_RECURSE sources_user "${CMAKE_CURRENT_SOURCE_DIR}/*user.c") -target_sources(app PRIVATE ${sources}) +target_sources(app PRIVATE ${sources} ${sources_user}) sdk_add_include_directories(.) sdk_add_include_directories(pikapython/pikascript-core) @@ -21,7 +22,4 @@ sdk_add_compile_definitions( sdk_set_main_file(main.c) -set(APP_LDFLAGS_HEAD "-Wl,--whole-archive") -set(APP_LDFLAGS_TAIL "-Wl,--no-whole-archive") - project(pikapython) diff --git a/examples/pikapython/FreeRTOSConfig.h b/examples/pikapython/FreeRTOSConfig.h index 24c39f26..f9b2668e 100755 --- a/examples/pikapython/FreeRTOSConfig.h +++ b/examples/pikapython/FreeRTOSConfig.h @@ -57,7 +57,7 @@ #define configTICK_RATE_HZ (1000) #define configMAX_PRIORITIES (7) #define configMINIMAL_STACK_SIZE ((unsigned short)128) /* Only needs to be this high as some demo tasks also use this constant. In production only the idle task would use this. */ -#define configTOTAL_HEAP_SIZE ((size_t)128 * 1024) +#define configTOTAL_HEAP_SIZE ((size_t)256* 1024) #define configMAX_TASK_NAME_LEN (16) #define configUSE_TRACE_FACILITY 1 #define configUSE_STATS_FORMATTING_FUNCTIONS 1 diff --git a/examples/pikapython/README.md b/examples/pikapython/README.md new file mode 100644 index 00000000..9ce3e217 --- /dev/null +++ b/examples/pikapython/README.md @@ -0,0 +1,37 @@ +# PikaPython on BL618 + +PikaPython is an ultra-lightweight Python engine that can run with only 4KB of RAM, zero dependencies, and easy to bind with C. It is similar to MicroPython and JerryScript, but much smaller and simpler. + +BL618 is a RISC-V based chip that supports PikaPython as an example program. + +This README will guide you through the steps of installing, using, and exploring the features and advantages of PikaPython on BL618. + +## How to build + +on windows: + +``` bash +make_bl618.cmd +``` + +## How to flash + +``` bash +make flash COMX= +``` + +## How to Connect + +The REPL is avalible on the USB virtual serial port. You can use any serial terminal program to connect to it. The default baud rate is 115200. + +After connecting, you can enter the REPL mode by pressing the Enter key. + +``` python +~~~/ POWERED BY \\~~~ +~ pikascript.com ~ +~~~~~~~~~~~~~~~~~~~~~ +hello PikaPython! +>>> print('hello BL618!') +hello BL618! +>>> +``` \ No newline at end of file diff --git a/examples/pikapython/main.c b/examples/pikapython/main.c index c213a1e7..edccf3ca 100644 --- a/examples/pikapython/main.c +++ b/examples/pikapython/main.c @@ -1,15 +1,18 @@ #include #include #include "./pikapython/pikascript-lib/PikaStdDevice/pika_hal.h" -#include "FreeRTOS.h" #include "bflb_flash.h" #include "bflb_gpio.h" #include "bflb_uart.h" #include "board.h" #include "log.h" +#include "usbd_cdc_user.h" // #include "lwip/init.h" #include "pikaScript.h" +#if PIKA_FREERTOS_ENABLE +#include "FreeRTOS.h" #include "task.h" +#endif #if defined(BL616) #include "bl616_glb.h" @@ -21,6 +24,11 @@ #include "bl808_glb.h" #endif +#define REPL_UART0 0 +#define REPL_USB 1 + +#define REPL_PORT REPL_USB + struct bflb_device_s* uartx = NULL; // static uint8_t freertos_heap[configTOTAL_HEAP_SIZE]; @@ -51,6 +59,8 @@ static int _pika_app_check(void) { uint8_t _pika_app_buf[_PIKA_APP_FLASH_SIZE] = {0}; static void consumer_task(void* pvParameters) { + cdc_acm_init(); + vTaskDelay(1000); PikaObj* root = newRootObj("root", New_PikaMain); if (_pika_app_check()) { printf("Load app.pika from flash\r\n"); @@ -96,16 +106,22 @@ static void _erise_app_task(void* pvParameters) { int main(void) { board_init(); + #if REPL_PORT == REPL_UART0 uartx = bflb_device_get_by_name("uart0"); bflb_uart_feature_control(uartx, UART_CMD_SET_BAUD_RATE, 115200); + #endif // xHeapRegions[0].xSizeInBytes = configTOTAL_HEAP_SIZE; // vPortDefineHeapRegions(xHeapRegions); // printf("Heap size: %d\r\n", configTOTAL_HEAP_SIZE); +#if PIKA_FREERTOS_ENABLE xTaskCreate(_erise_app_task, (char*)"erise_app_task", 8192, NULL, configMAX_PRIORITIES - 1, NULL); - xTaskCreate(consumer_task, (char*)"consumer_task", 8192, NULL, 3, NULL); + xTaskCreate(consumer_task, (char*)"consumer_task", 8 * 1024, NULL, 3, NULL); vTaskStartScheduler(); +#else + consumer_task(NULL); +#endif while (1) { } @@ -114,17 +130,25 @@ int main(void) { /* Platform Porting */ char pika_platform_getchar(void) { + #if REPL_PORT == REPL_UART0 while (1) { int c = bflb_uart_getchar(uartx); if (c != -1) { return c; } } + #elif REPL_PORT == REPL_USB + return usb_cdc_user_getchar(); + #endif } int pika_platform_putchar(char ch) { + #if REPL_PORT == REPL_UART0 bflb_uart_putchar(uartx, ch); return 0; + #elif REPL_PORT == REPL_USB + return usb_cdc_user_putchar(ch); + #endif } void pika_platform_reboot(void) { @@ -132,11 +156,19 @@ void pika_platform_reboot(void) { } void* pika_platform_malloc(size_t size) { +#if PIKA_FREERTOS_ENABLE return pvPortMalloc(size); +#else + return malloc(size); +#endif } void pika_platform_free(void* ptr) { +#if PIKA_FREERTOS_ENABLE return vPortFree(ptr); +#else + free(ptr); +#endif } /* fopen */ diff --git a/examples/pikapython/pika_config.h b/examples/pikapython/pika_config.h index a781afc8..8845f0af 100755 --- a/examples/pikapython/pika_config.h +++ b/examples/pikapython/pika_config.h @@ -2,4 +2,8 @@ #define PIKA_FREERTOS_ENABLE 1 #define PIKA_THREAD_STACK_SIZE 4096 #define PIKA_SHELL_SAVE_APP_ENABLE 1 -#define PIKA_STACK_BUFF_SIZE 512 \ No newline at end of file +#define PIKA_STACK_BUFF_SIZE 512 +#define PIKA_OPTIMIZE PIKA_OPTIMIZE_SPEED +// #define PIKA_ASSERT_ENABLE 1 +// #define PIKA_GC_MARK_SWEEP_ENABLE 1 +// #define PIKA_KERNAL_DEBUG_ENABLE 1 \ No newline at end of file diff --git a/examples/pikapython/pikapython/PikaStdData.pyi b/examples/pikapython/pikapython/PikaStdData.pyi index 6352ec94..14b32806 100644 --- a/examples/pikapython/pikapython/PikaStdData.pyi +++ b/examples/pikapython/pikapython/PikaStdData.pyi @@ -134,6 +134,7 @@ class String: def replace(self, old: str, new: str) -> str: ... def strip(self, *chrs) -> str: ... def format(self, *vars) -> str: ... + def join(self, val: any) -> str: ... class ByteArray: diff --git a/examples/pikapython/pikapython/PikaStdLib.pyi b/examples/pikapython/pikapython/PikaStdLib.pyi index 4e702519..e72245b9 100644 --- a/examples/pikapython/pikapython/PikaStdLib.pyi +++ b/examples/pikapython/pikapython/PikaStdLib.pyi @@ -130,6 +130,14 @@ class SysObj: @PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE") def reboot(): ... + @staticmethod + @PIKA_C_MACRO_IF("!PIKA_NANO_ENABLE") + def clear(): ... + + @staticmethod + @PIKA_C_MACRO_IF("PIKA_GC_MARK_SWEEP_ENABLE") + def gcdump(): ... + @PIKA_C_MACRO_IF("0") class RangeObj: diff --git a/examples/pikapython/pikapython/modbus.py b/examples/pikapython/pikapython/modbus.py index c0f020e7..89175708 100755 --- a/examples/pikapython/pikapython/modbus.py +++ b/examples/pikapython/pikapython/modbus.py @@ -2,12 +2,33 @@ import _modbus class ModBus(_modbus._ModBus): + """ + A subclass of _modbus._ModBus that provides methods for serializing and sending modbus messages. + """ def serializeWriteBits(self, addr: int, src: list) -> bytes: - lenth = super().serializeWriteBits(addr, len(list), bytes(src)) + """Serialize a write multiple coils request. + + Args: + addr (int): The starting address of the coils to be written. + src (list): A list of boolean values (0 or 1) to be written to the coils. + + Returns: + bytes: The serialized message as a bytes object. + """ + lenth = super().serializeWriteBits(addr, len(src), bytes(src)) return self.sendBuff[0:lenth] def serializeWriteRegisters(self, addr: int, src: list) -> bytes: + """Serialize a write multiple registers request. + + Args: + addr (int): The starting address of the registers to be written. + src (list): A list of integer values (0-65535) to be written to the registers. + + Returns: + bytes: The serialized message as a bytes object. + """ _src = bytes(2 * len(src)) for i in range(len(src)): _src[2 * i] = src[i] % 256 @@ -16,26 +37,80 @@ class ModBus(_modbus._ModBus): return self.sendBuff[0:lenth] def serializeReadBits(self, addr: int, nb: int) -> bytes: + """Serialize a read coils request. + + Args: + addr (int): The starting address of the coils to be read. + nb (int): The number of coils to be read. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeReadBits(addr, nb) return self.sendBuff[0:lenth] def serializeReadInputBits(self, addr: int, nb: int) -> bytes: + """Serialize a read discrete inputs request. + + Args: + addr (int): The starting address of the discrete inputs to be read. + nb (int): The number of discrete inputs to be read. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeReadInputBits(addr, nb) return self.sendBuff[0:lenth] def serializeReadRegisters(self, addr: int, nb: int) -> bytes: + """Serialize a read holding registers request. + + Args: + addr (int): The starting address of the holding registers to be read. + nb (int): The number of holding registers to be read. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeReadRegisters(addr, nb) return self.sendBuff[0:lenth] def serializeReadInputRegisters(self, addr: int, nb: int) -> bytes: + """Serialize a read input registers request. + + Args: + addr (int): The starting address of the input registers to be read. + nb (int): The number of input registers to be read. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeReadInputRegisters(addr, nb) return self.sendBuff[0:lenth] def serializeWriteBit(self, addr: int, status: int) -> bytes: + """Serialize a write single coil request. + + Args: + addr (int): The address of the coil to be written. + status (int): The value (0 or 1) to be written to the coil. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeWriteBit(addr, status) return self.sendBuff[0:lenth] def serializeWriteRegister(self, addr: int, value: int) -> bytes: + """Serialize a write single register request. + + Args: + addr (int): The address of the register to be written. + value (int): The value (0-65535) to be written to the register. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeWriteRegister(addr, value) return self.sendBuff[0:lenth] @@ -43,14 +118,37 @@ class ModBus(_modbus._ModBus): addr: int, andMask: int, orMask: int) -> bytes: + """Serialize a mask write register request. + + Args: + addr (int): The address of the register to be modified. + andMask (int): The AND mask to be applied to the current value of the register. + orMask (int): The OR mask to be applied to the result of the AND operation. + + Returns: + bytes: The serialized message as a bytes object. + """ lenth = super().serializeMaskWriteRegister(addr, andMask, orMask) return self.sendBuff[0:lenth] def serializeReportSlaveId(self) -> int: + """Serialize a report slave ID request. + + Returns: + int: The length of the serialized message in bytes. + """ lenth = super().serializeReportSlaveId() return self.sendBuff[0:lenth] def deserializeReadRegisters(self, msg: bytes) -> list: + """Deserialize a read holding registers response. + + Args: + msg (bytes): The received message as a bytes object. + + Returns: + list: A list of integer values (0-65535) read from the registers. + """ self.readBuff = msg dest = super().deserializeReadRegisters(len(msg)) ret = [] @@ -59,18 +157,42 @@ class ModBus(_modbus._ModBus): return ret def deserializeReadBits(self, msg: bytes) -> list: + """Deserialize a read coils response. + + Args: + msg (bytes): The received message as a bytes object. + + Returns: + list: A list of boolean values (True or False) read from the coils. + """ self.readBuff = msg length = len(msg) dest = super().deserializeReadBits(length) return list(dest) def deserializeReadInputBits(self, msg: bytes) -> list: + """Deserialize a read discrete inputs response. + + Args: + msg (bytes): The received message as a bytes object. + + Returns: + list: A list of boolean values (True or False) read from the discrete inputs. + """ self.readBuff = msg length = len(msg) dest = super().deserializeReadInputBits(length) return list(dest) def deserializeReadInputRegisters(self, msg: bytes) -> list: + """Deserialize a read input registers response. + + Args: + msg (bytes): The received message as a bytes object. + + Returns: + list: A list of integer values (0-65535) read from the input registers. + """ self.readBuff = msg length = len(msg) dest = super().deserializeReadInputRegisters(length) @@ -80,6 +202,14 @@ class ModBus(_modbus._ModBus): return ret def deserializeWriteAndReadRegisters(self, msg: bytes) -> list: + """Deserialize a write and read registers response. + + Args: + msg (bytes): The received message as a bytes object. + + Returns: + list: A list of integer values (0-65535) written to and read from the registers. + """ self.readBuff = msg length = len(msg) dest = super().deserializeWriteAndReadRegisters(length) @@ -91,9 +221,21 @@ class ModBus(_modbus._ModBus): class ModBusRTU(ModBus): def __init__(self, sendBuffSize: int, readBuffSize: int): + """Initialize a Modbus RTU protocol instance. + + Args: + sendBuffSize (int): The size of the send buffer in bytes. + readBuffSize (int): The size of the read buffer in bytes. + """ self.__init__rtu(sendBuffSize, readBuffSize) class ModBusTCP(ModBus): def __init__(self, sendBuffSize: int, readBuffSize: int): + """Initialize a Modbus TCP protocol instance. + + Args: + sendBuffSize (int): The size of the send buffer in bytes. + readBuffSize (int): The size of the read buffer in bytes. + """ self.__init__tcp(sendBuffSize, readBuffSize) diff --git a/examples/pikapython/pikapython/pika_libc.pyi b/examples/pikapython/pikapython/pika_libc.pyi new file mode 100644 index 00000000..e69de29b diff --git a/examples/pikapython/pikapython/pika_lvgl.pyi b/examples/pikapython/pikapython/pika_lvgl.pyi index 59493766..49096400 100755 --- a/examples/pikapython/pikapython/pika_lvgl.pyi +++ b/examples/pikapython/pikapython/pika_lvgl.pyi @@ -4,6 +4,7 @@ from PikaObj import * def __init__(): ... +def __del__(): ... class EVENT: ALL: int @@ -390,6 +391,7 @@ class lv_obj: def set_id(self, id: str): ... def get_id(self) -> str: ... def clean(self): ... + def del_(self): ... class indev_t: diff --git a/examples/pikapython/pikapython/pikascript-api/PikaDebug.h b/examples/pikapython/pikapython/pikascript-api/PikaDebug.h new file mode 100644 index 00000000..384668c7 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaDebug.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaDebug__H +#define __PikaDebug__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaDebug(Args *args); + +Arg* PikaDebug_Debuger(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaDebug_Debuger.h b/examples/pikapython/pikapython/pikascript-api/PikaDebug_Debuger.h new file mode 100644 index 00000000..5a8f1b0d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaDebug_Debuger.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaDebug_Debuger__H +#define __PikaDebug_Debuger__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaDebug_Debuger(Args *args); + +void PikaDebug_Debuger___init__(PikaObj *self); +void PikaDebug_Debuger_set_trace(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaMain.h b/examples/pikapython/pikapython/pikascript-api/PikaMain.h new file mode 100644 index 00000000..38fa53ba --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaMain.h @@ -0,0 +1,21 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaMain__H +#define __PikaMain__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaMain(Args *args); + + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaMath.h b/examples/pikapython/pikapython/pikascript-api/PikaMath.h new file mode 100644 index 00000000..aa3e3941 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaMath.h @@ -0,0 +1,24 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaMath__H +#define __PikaMath__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaMath(Args *args); + +Arg* PikaMath_Math(PikaObj *self); +Arg* PikaMath_Operator(PikaObj *self); +Arg* PikaMath_Quaternion(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaMath_Math.h b/examples/pikapython/pikapython/pikascript-api/PikaMath_Math.h new file mode 100644 index 00000000..a56a474e --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaMath_Math.h @@ -0,0 +1,46 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaMath_Math__H +#define __PikaMath_Math__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaMath_Math(Args *args); + +void PikaMath_Math___init__(PikaObj *self); +pika_float PikaMath_Math_acos(PikaObj *self, pika_float x); +pika_float PikaMath_Math_asin(PikaObj *self, pika_float x); +pika_float PikaMath_Math_atan(PikaObj *self, pika_float x); +pika_float PikaMath_Math_atan2(PikaObj *self, pika_float x, pika_float y); +int PikaMath_Math_ceil(PikaObj *self, pika_float x); +pika_float PikaMath_Math_cos(PikaObj *self, pika_float x); +pika_float PikaMath_Math_cosh(PikaObj *self, pika_float x); +pika_float PikaMath_Math_degrees(PikaObj *self, pika_float x); +pika_float PikaMath_Math_exp(PikaObj *self, pika_float x); +pika_float PikaMath_Math_fabs(PikaObj *self, pika_float x); +int PikaMath_Math_floor(PikaObj *self, pika_float x); +pika_float PikaMath_Math_fmod(PikaObj *self, pika_float x, pika_float y); +pika_float PikaMath_Math_log(PikaObj *self, pika_float x); +pika_float PikaMath_Math_log10(PikaObj *self, pika_float x); +pika_float PikaMath_Math_log2(PikaObj *self, pika_float x); +pika_float PikaMath_Math_pow(PikaObj *self, pika_float x, pika_float y); +pika_float PikaMath_Math_radians(PikaObj *self, pika_float x); +pika_float PikaMath_Math_remainder(PikaObj *self, pika_float x, pika_float y); +pika_float PikaMath_Math_sin(PikaObj *self, pika_float x); +pika_float PikaMath_Math_sinh(PikaObj *self, pika_float x); +pika_float PikaMath_Math_sqrt(PikaObj *self, pika_float x); +pika_float PikaMath_Math_tan(PikaObj *self, pika_float x); +pika_float PikaMath_Math_tanh(PikaObj *self, pika_float x); +pika_float PikaMath_Math_trunc(PikaObj *self, pika_float x); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaMath_Operator.h b/examples/pikapython/pikapython/pikascript-api/PikaMath_Operator.h new file mode 100644 index 00000000..9b72816f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaMath_Operator.h @@ -0,0 +1,36 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaMath_Operator__H +#define __PikaMath_Operator__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaMath_Operator(Args *args); + +int PikaMath_Operator_AND(PikaObj *self, int flag1, int flag2); +int PikaMath_Operator_NOT(PikaObj *self, int flag); +int PikaMath_Operator_OR(PikaObj *self, int flag1, int flag2); +void PikaMath_Operator___del__(PikaObj *self); +char* PikaMath_Operator___str__(PikaObj *self); +int PikaMath_Operator_equalFloat(PikaObj *self, pika_float num1, pika_float num2); +int PikaMath_Operator_equalInt(PikaObj *self, int num1, int num2); +int PikaMath_Operator_graterThanFloat(PikaObj *self, pika_float num1, pika_float num2); +int PikaMath_Operator_graterThanInt(PikaObj *self, int num1, int num2); +int PikaMath_Operator_lessThanFloat(PikaObj *self, pika_float num1, pika_float num2); +int PikaMath_Operator_lessThanInt(PikaObj *self, int num1, int num2); +pika_float PikaMath_Operator_minusFloat(PikaObj *self, pika_float num1, pika_float num2); +int PikaMath_Operator_minusInt(PikaObj *self, int num1, int num2); +pika_float PikaMath_Operator_plusFloat(PikaObj *self, pika_float num1, pika_float num2); +int PikaMath_Operator_plusInt(PikaObj *self, int num1, int num2); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaMath_Quaternion.h b/examples/pikapython/pikapython/pikascript-api/PikaMath_Quaternion.h new file mode 100644 index 00000000..81340b70 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaMath_Quaternion.h @@ -0,0 +1,37 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaMath_Quaternion__H +#define __PikaMath_Quaternion__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaMath_Quaternion(Args *args); + +void PikaMath_Quaternion___init__(PikaObj *self); +void PikaMath_Quaternion_add(PikaObj *self, PikaObj* quat); +void PikaMath_Quaternion_crossproduct(PikaObj *self, PikaObj* quat); +pika_float PikaMath_Quaternion_dot(PikaObj *self, PikaObj* quat); +void PikaMath_Quaternion_fromEuler(PikaObj *self, pika_float yaw, pika_float pitch, pika_float roll, int mode); +pika_float PikaMath_Quaternion_get(PikaObj *self, int key); +void PikaMath_Quaternion_inverse(PikaObj *self); +int PikaMath_Quaternion_isnormalize(PikaObj *self); +pika_float PikaMath_Quaternion_magnituded(PikaObj *self); +pika_float PikaMath_Quaternion_magnitudedsquare(PikaObj *self); +void PikaMath_Quaternion_mul(PikaObj *self, PikaObj* quat); +void PikaMath_Quaternion_normalize(PikaObj *self); +void PikaMath_Quaternion_reverse(PikaObj *self); +void PikaMath_Quaternion_set(PikaObj *self, pika_float x, pika_float y, pika_float z, pika_float w); +void PikaMath_Quaternion_sub(PikaObj *self, PikaObj* quat); +PikaObj* PikaMath_Quaternion_toEuler(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData.h new file mode 100644 index 00000000..637de8e9 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData.h @@ -0,0 +1,30 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData__H +#define __PikaStdData__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData(Args *args); + +Arg* PikaStdData_ByteArray(PikaObj *self); +Arg* PikaStdData_Dict(PikaObj *self); +Arg* PikaStdData_FILEIO(PikaObj *self); +Arg* PikaStdData_List(PikaObj *self); +Arg* PikaStdData_String(PikaObj *self); +Arg* PikaStdData_Tuple(PikaObj *self); +Arg* PikaStdData_Utils(PikaObj *self); +Arg* PikaStdData_dict_items(PikaObj *self); +Arg* PikaStdData_dict_keys(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_ByteArray.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_ByteArray.h new file mode 100644 index 00000000..9f4ee428 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_ByteArray.h @@ -0,0 +1,28 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_ByteArray__H +#define __PikaStdData_ByteArray__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_ByteArray(Args *args); + +int PikaStdData_ByteArray___getitem__(PikaObj *self, int __key); +void PikaStdData_ByteArray___init__(PikaObj *self, Arg* bytes); +Arg* PikaStdData_ByteArray___iter__(PikaObj *self); +Arg* PikaStdData_ByteArray___next__(PikaObj *self); +void PikaStdData_ByteArray___setitem__(PikaObj *self, int __key, int __val); +char* PikaStdData_ByteArray___str__(PikaObj *self); +char* PikaStdData_ByteArray_decode(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_Dict.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Dict.h new file mode 100644 index 00000000..61f8d767 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Dict.h @@ -0,0 +1,36 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_Dict__H +#define __PikaStdData_Dict__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_Dict(Args *args); + +int PikaStdData_Dict___contains__(PikaObj *self, Arg* val); +void PikaStdData_Dict___del__(PikaObj *self); +Arg* PikaStdData_Dict___getitem__(PikaObj *self, Arg* __key); +void PikaStdData_Dict___init__(PikaObj *self); +Arg* PikaStdData_Dict___iter__(PikaObj *self); +int PikaStdData_Dict___len__(PikaObj *self); +Arg* PikaStdData_Dict___next__(PikaObj *self); +void PikaStdData_Dict___setitem__(PikaObj *self, Arg* __key, Arg* __val); +char* PikaStdData_Dict___str__(PikaObj *self); +Arg* PikaStdData_Dict_get(PikaObj *self, char* key); +PikaObj* PikaStdData_Dict_items(PikaObj *self); +PikaObj* PikaStdData_Dict_keys(PikaObj *self); +void PikaStdData_Dict_remove(PikaObj *self, char* key); +void PikaStdData_Dict_set(PikaObj *self, char* key, Arg* arg); +void PikaStdData_Dict_update(PikaObj *self, PikaObj* other); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_FILEIO.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_FILEIO.h new file mode 100644 index 00000000..5477e0b3 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_FILEIO.h @@ -0,0 +1,30 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_FILEIO__H +#define __PikaStdData_FILEIO__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_FILEIO(Args *args); + +void PikaStdData_FILEIO_close(PikaObj *self); +int PikaStdData_FILEIO_init(PikaObj *self, char* path, char* mode); +Arg* PikaStdData_FILEIO_read(PikaObj *self, PikaTuple* size); +char* PikaStdData_FILEIO_readline(PikaObj *self); +PikaObj* PikaStdData_FILEIO_readlines(PikaObj *self); +int PikaStdData_FILEIO_seek(PikaObj *self, int offset, PikaTuple* fromwhere); +int PikaStdData_FILEIO_tell(PikaObj *self); +int PikaStdData_FILEIO_write(PikaObj *self, Arg* s); +void PikaStdData_FILEIO_writelines(PikaObj *self, PikaObj* lines); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_List.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_List.h new file mode 100644 index 00000000..3fe8840f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_List.h @@ -0,0 +1,31 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_List__H +#define __PikaStdData_List__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_List(Args *args); + +PikaObj* PikaStdData_List___add__(PikaObj *self, PikaObj* others); +void PikaStdData_List___init__(PikaObj *self); +void PikaStdData_List___setitem__(PikaObj *self, Arg* __key, Arg* __val); +char* PikaStdData_List___str__(PikaObj *self); +void PikaStdData_List_append(PikaObj *self, Arg* arg); +void PikaStdData_List_insert(PikaObj *self, int i, Arg* arg); +Arg* PikaStdData_List_pop(PikaObj *self); +void PikaStdData_List_remove(PikaObj *self, Arg* val); +void PikaStdData_List_reverse(PikaObj *self); +void PikaStdData_List_set(PikaObj *self, int i, Arg* arg); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_String.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_String.h new file mode 100644 index 00000000..2a54f77a --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_String.h @@ -0,0 +1,43 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_String__H +#define __PikaStdData_String__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_String(Args *args); + +Arg* PikaStdData_String___getitem__(PikaObj *self, Arg* __key); +void PikaStdData_String___init__(PikaObj *self, char* s); +Arg* PikaStdData_String___iter__(PikaObj *self); +int PikaStdData_String___len__(PikaObj *self); +Arg* PikaStdData_String___next__(PikaObj *self); +void PikaStdData_String___setitem__(PikaObj *self, Arg* __key, Arg* __val); +char* PikaStdData_String___str__(PikaObj *self); +Arg* PikaStdData_String_encode(PikaObj *self, PikaTuple* encoding); +int PikaStdData_String_endswith(PikaObj *self, char* suffix); +char* PikaStdData_String_format(PikaObj *self, PikaTuple* vars); +char* PikaStdData_String_get(PikaObj *self); +int PikaStdData_String_isalnum(PikaObj *self); +int PikaStdData_String_isalpha(PikaObj *self); +int PikaStdData_String_isdigit(PikaObj *self); +int PikaStdData_String_islower(PikaObj *self); +int PikaStdData_String_isspace(PikaObj *self); +char* PikaStdData_String_join(PikaObj *self, Arg* val); +char* PikaStdData_String_replace(PikaObj *self, char* old, char* new); +void PikaStdData_String_set(PikaObj *self, char* s); +PikaObj* PikaStdData_String_split(PikaObj *self, char* s); +int PikaStdData_String_startswith(PikaObj *self, char* prefix); +char* PikaStdData_String_strip(PikaObj *self, PikaTuple* chrs); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_Tuple.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Tuple.h new file mode 100644 index 00000000..c09be162 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Tuple.h @@ -0,0 +1,31 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_Tuple__H +#define __PikaStdData_Tuple__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_Tuple(Args *args); + +int PikaStdData_Tuple___contains__(PikaObj *self, Arg* val); +void PikaStdData_Tuple___del__(PikaObj *self); +Arg* PikaStdData_Tuple___getitem__(PikaObj *self, Arg* __key); +void PikaStdData_Tuple___init__(PikaObj *self); +Arg* PikaStdData_Tuple___iter__(PikaObj *self); +int PikaStdData_Tuple___len__(PikaObj *self); +Arg* PikaStdData_Tuple___next__(PikaObj *self); +char* PikaStdData_Tuple___str__(PikaObj *self); +Arg* PikaStdData_Tuple_get(PikaObj *self, int i); +int PikaStdData_Tuple_len(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_Utils.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Utils.h new file mode 100644 index 00000000..892f8498 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_Utils.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_Utils__H +#define __PikaStdData_Utils__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_Utils(Args *args); + +Arg* PikaStdData_Utils_int_to_bytes(PikaObj *self, int val); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_items.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_items.h new file mode 100644 index 00000000..35640ad7 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_items.h @@ -0,0 +1,25 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_dict_items__H +#define __PikaStdData_dict_items__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_dict_items(Args *args); + +Arg* PikaStdData_dict_items___iter__(PikaObj *self); +int PikaStdData_dict_items___len__(PikaObj *self); +Arg* PikaStdData_dict_items___next__(PikaObj *self); +char* PikaStdData_dict_items___str__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_keys.h b/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_keys.h new file mode 100644 index 00000000..832d293b --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdData_dict_keys.h @@ -0,0 +1,25 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdData_dict_keys__H +#define __PikaStdData_dict_keys__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdData_dict_keys(Args *args); + +Arg* PikaStdData_dict_keys___iter__(PikaObj *self); +int PikaStdData_dict_keys___len__(PikaObj *self); +Arg* PikaStdData_dict_keys___next__(PikaObj *self); +char* PikaStdData_dict_keys___str__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice.h new file mode 100644 index 00000000..eb14be16 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice.h @@ -0,0 +1,31 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice__H +#define __PikaStdDevice__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice(Args *args); + +Arg* PikaStdDevice_ADC(PikaObj *self); +Arg* PikaStdDevice_BaseDev(PikaObj *self); +Arg* PikaStdDevice_CAN(PikaObj *self); +Arg* PikaStdDevice_DAC(PikaObj *self); +Arg* PikaStdDevice_GPIO(PikaObj *self); +Arg* PikaStdDevice_IIC(PikaObj *self); +Arg* PikaStdDevice_PWM(PikaObj *self); +Arg* PikaStdDevice_SPI(PikaObj *self); +PikaObj* PikaStdDevice_Time(PikaObj *self); +Arg* PikaStdDevice_UART(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_ADC.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_ADC.h new file mode 100644 index 00000000..c93b9e68 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_ADC.h @@ -0,0 +1,30 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_ADC__H +#define __PikaStdDevice_ADC__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_ADC(Args *args); + +void PikaStdDevice_ADC___init__(PikaObj *self); +void PikaStdDevice_ADC_close(PikaObj *self); +void PikaStdDevice_ADC_disable(PikaObj *self); +void PikaStdDevice_ADC_enable(PikaObj *self); +void PikaStdDevice_ADC_platformDisable(PikaObj *self); +void PikaStdDevice_ADC_platformEnable(PikaObj *self); +void PikaStdDevice_ADC_platformRead(PikaObj *self); +pika_float PikaStdDevice_ADC_read(PikaObj *self); +void PikaStdDevice_ADC_setPin(PikaObj *self, char* pin); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_BaseDev.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_BaseDev.h new file mode 100644 index 00000000..ddb5156d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_BaseDev.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_BaseDev__H +#define __PikaStdDevice_BaseDev__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_BaseDev(Args *args); + +void PikaStdDevice_BaseDev_addEventCallBack(PikaObj *self, Arg* eventCallback); +void PikaStdDevice_BaseDev_platformGetEventId(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_CAN.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_CAN.h new file mode 100644 index 00000000..e426989d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_CAN.h @@ -0,0 +1,39 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_CAN__H +#define __PikaStdDevice_CAN__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_CAN(Args *args); + +void PikaStdDevice_CAN___init__(PikaObj *self); +void PikaStdDevice_CAN_addFilter(PikaObj *self, int id, int ide, int rtr, int mode, int mask, int hdr); +void PikaStdDevice_CAN_disable(PikaObj *self); +void PikaStdDevice_CAN_enable(PikaObj *self); +void PikaStdDevice_CAN_platformDisable(PikaObj *self); +void PikaStdDevice_CAN_platformEnable(PikaObj *self); +void PikaStdDevice_CAN_platformRead(PikaObj *self); +void PikaStdDevice_CAN_platformReadBytes(PikaObj *self); +void PikaStdDevice_CAN_platformWrite(PikaObj *self); +void PikaStdDevice_CAN_platformWriteBytes(PikaObj *self); +char* PikaStdDevice_CAN_read(PikaObj *self, int length); +Arg* PikaStdDevice_CAN_readBytes(PikaObj *self, int length); +void PikaStdDevice_CAN_setBaudRate(PikaObj *self, int baudRate); +void PikaStdDevice_CAN_setId(PikaObj *self, int id); +void PikaStdDevice_CAN_setMode(PikaObj *self, char* mode); +void PikaStdDevice_CAN_setName(PikaObj *self, char* name); +void PikaStdDevice_CAN_write(PikaObj *self, char* data); +void PikaStdDevice_CAN_writeBytes(PikaObj *self, uint8_t* data, int length); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_DAC.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_DAC.h new file mode 100644 index 00000000..4ab1571a --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_DAC.h @@ -0,0 +1,27 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_DAC__H +#define __PikaStdDevice_DAC__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_DAC(Args *args); + +void PikaStdDevice_DAC___init__(PikaObj *self); +void PikaStdDevice_DAC_close(PikaObj *self); +void PikaStdDevice_DAC_disable(PikaObj *self); +void PikaStdDevice_DAC_enable(PikaObj *self); +void PikaStdDevice_DAC_setPin(PikaObj *self, char* pin); +void PikaStdDevice_DAC_write(PikaObj *self, pika_float val); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_GPIO.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_GPIO.h new file mode 100644 index 00000000..02de272d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_GPIO.h @@ -0,0 +1,42 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_GPIO__H +#define __PikaStdDevice_GPIO__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_GPIO(Args *args); + +void PikaStdDevice_GPIO___init__(PikaObj *self); +void PikaStdDevice_GPIO_close(PikaObj *self); +void PikaStdDevice_GPIO_disable(PikaObj *self); +void PikaStdDevice_GPIO_enable(PikaObj *self); +int PikaStdDevice_GPIO_getId(PikaObj *self); +char* PikaStdDevice_GPIO_getMode(PikaObj *self); +char* PikaStdDevice_GPIO_getPin(PikaObj *self); +void PikaStdDevice_GPIO_high(PikaObj *self); +void PikaStdDevice_GPIO_low(PikaObj *self); +void PikaStdDevice_GPIO_platformDisable(PikaObj *self); +void PikaStdDevice_GPIO_platformEnable(PikaObj *self); +void PikaStdDevice_GPIO_platformHigh(PikaObj *self); +void PikaStdDevice_GPIO_platformLow(PikaObj *self); +void PikaStdDevice_GPIO_platformRead(PikaObj *self); +void PikaStdDevice_GPIO_platformSetMode(PikaObj *self); +int PikaStdDevice_GPIO_read(PikaObj *self); +void PikaStdDevice_GPIO_setCallBack(PikaObj *self, Arg* eventCallBack, int filter); +void PikaStdDevice_GPIO_setId(PikaObj *self, int id); +void PikaStdDevice_GPIO_setMode(PikaObj *self, char* mode); +void PikaStdDevice_GPIO_setPin(PikaObj *self, char* pinName); +void PikaStdDevice_GPIO_setPull(PikaObj *self, char* pull); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_IIC.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_IIC.h new file mode 100644 index 00000000..24501b00 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_IIC.h @@ -0,0 +1,37 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_IIC__H +#define __PikaStdDevice_IIC__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_IIC(Args *args); + +void PikaStdDevice_IIC___init__(PikaObj *self); +void PikaStdDevice_IIC_disable(PikaObj *self); +void PikaStdDevice_IIC_enable(PikaObj *self); +void PikaStdDevice_IIC_platformDisable(PikaObj *self); +void PikaStdDevice_IIC_platformEnable(PikaObj *self); +void PikaStdDevice_IIC_platformRead(PikaObj *self); +void PikaStdDevice_IIC_platformReadBytes(PikaObj *self); +void PikaStdDevice_IIC_platformWrite(PikaObj *self); +void PikaStdDevice_IIC_platformWriteBytes(PikaObj *self); +char* PikaStdDevice_IIC_read(PikaObj *self, int addr, int length); +Arg* PikaStdDevice_IIC_readBytes(PikaObj *self, int addr, int length); +void PikaStdDevice_IIC_setDeviceAddr(PikaObj *self, int addr); +void PikaStdDevice_IIC_setPinSCL(PikaObj *self, char* pin); +void PikaStdDevice_IIC_setPinSDA(PikaObj *self, char* pin); +void PikaStdDevice_IIC_write(PikaObj *self, int addr, char* data); +void PikaStdDevice_IIC_writeBytes(PikaObj *self, int addr, uint8_t* data, int length); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_PWM.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_PWM.h new file mode 100644 index 00000000..1ec6acfc --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_PWM.h @@ -0,0 +1,39 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_PWM__H +#define __PikaStdDevice_PWM__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_PWM(Args *args); + +void PikaStdDevice_PWM___init__(PikaObj *self); +void PikaStdDevice_PWM_close(PikaObj *self); +void PikaStdDevice_PWM_disable(PikaObj *self); +void PikaStdDevice_PWM_enable(PikaObj *self); +int PikaStdDevice_PWM_getChannel(PikaObj *self); +pika_float PikaStdDevice_PWM_getDuty(PikaObj *self); +int PikaStdDevice_PWM_getFrequency(PikaObj *self); +char* PikaStdDevice_PWM_getName(PikaObj *self); +void PikaStdDevice_PWM_platformDisable(PikaObj *self); +void PikaStdDevice_PWM_platformEnable(PikaObj *self); +void PikaStdDevice_PWM_platformSetDuty(PikaObj *self); +void PikaStdDevice_PWM_platformSetFrequency(PikaObj *self); +void PikaStdDevice_PWM_setChannel(PikaObj *self, int ch); +void PikaStdDevice_PWM_setDuty(PikaObj *self, pika_float duty); +void PikaStdDevice_PWM_setFreq(PikaObj *self, int freq); +void PikaStdDevice_PWM_setFrequency(PikaObj *self, int freq); +void PikaStdDevice_PWM_setName(PikaObj *self, char* name); +void PikaStdDevice_PWM_setPin(PikaObj *self, char* pin); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_SPI.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_SPI.h new file mode 100644 index 00000000..85065ad8 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_SPI.h @@ -0,0 +1,42 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_SPI__H +#define __PikaStdDevice_SPI__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_SPI(Args *args); + +void PikaStdDevice_SPI___init__(PikaObj *self); +void PikaStdDevice_SPI_disable(PikaObj *self); +void PikaStdDevice_SPI_enable(PikaObj *self); +void PikaStdDevice_SPI_platformDisable(PikaObj *self); +void PikaStdDevice_SPI_platformEnable(PikaObj *self); +void PikaStdDevice_SPI_platformRead(PikaObj *self); +void PikaStdDevice_SPI_platformReadBytes(PikaObj *self); +void PikaStdDevice_SPI_platformWrite(PikaObj *self); +void PikaStdDevice_SPI_platformWriteBytes(PikaObj *self); +char* PikaStdDevice_SPI_read(PikaObj *self, int length); +Arg* PikaStdDevice_SPI_readBytes(PikaObj *self, int length); +void PikaStdDevice_SPI_setBaudRate(PikaObj *self, int baudRate); +void PikaStdDevice_SPI_setId(PikaObj *self, int id); +void PikaStdDevice_SPI_setName(PikaObj *self, char* name); +void PikaStdDevice_SPI_setPhase(PikaObj *self, int phase); +void PikaStdDevice_SPI_setPinMISO(PikaObj *self, char* pin); +void PikaStdDevice_SPI_setPinMOSI(PikaObj *self, char* pin); +void PikaStdDevice_SPI_setPinSCK(PikaObj *self, char* pin); +void PikaStdDevice_SPI_setPolarity(PikaObj *self, int polarity); +void PikaStdDevice_SPI_write(PikaObj *self, char* data); +void PikaStdDevice_SPI_writeBytes(PikaObj *self, uint8_t* data, int length); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_UART.h b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_UART.h new file mode 100644 index 00000000..4b637a07 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdDevice_UART.h @@ -0,0 +1,43 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdDevice_UART__H +#define __PikaStdDevice_UART__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdDevice_UART(Args *args); + +void PikaStdDevice_UART___init__(PikaObj *self); +void PikaStdDevice_UART_close(PikaObj *self); +void PikaStdDevice_UART_disable(PikaObj *self); +void PikaStdDevice_UART_enable(PikaObj *self); +void PikaStdDevice_UART_platformDisable(PikaObj *self); +void PikaStdDevice_UART_platformEnable(PikaObj *self); +void PikaStdDevice_UART_platformRead(PikaObj *self); +void PikaStdDevice_UART_platformReadBytes(PikaObj *self); +void PikaStdDevice_UART_platformWrite(PikaObj *self); +void PikaStdDevice_UART_platformWriteBytes(PikaObj *self); +char* PikaStdDevice_UART_read(PikaObj *self, int length); +Arg* PikaStdDevice_UART_readBytes(PikaObj *self, int length); +void PikaStdDevice_UART_setBaudRate(PikaObj *self, int baudRate); +void PikaStdDevice_UART_setCallBack(PikaObj *self, Arg* eventCallBack, int filter); +void PikaStdDevice_UART_setFlowControl(PikaObj *self, int flowControl); +void PikaStdDevice_UART_setId(PikaObj *self, int id); +void PikaStdDevice_UART_setPinCTS(PikaObj *self, char* pin); +void PikaStdDevice_UART_setPinRTS(PikaObj *self, char* pin); +void PikaStdDevice_UART_setPinRX(PikaObj *self, char* pin); +void PikaStdDevice_UART_setPinTX(PikaObj *self, char* pin); +void PikaStdDevice_UART_write(PikaObj *self, char* data); +void PikaStdDevice_UART_writeBytes(PikaObj *self, uint8_t* data, int length); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdLib.h b/examples/pikapython/pikapython/pikascript-api/PikaStdLib.h new file mode 100644 index 00000000..d0ac36ec --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdLib.h @@ -0,0 +1,25 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdLib__H +#define __PikaStdLib__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdLib(Args *args); + +Arg* PikaStdLib_MemChecker(PikaObj *self); +Arg* PikaStdLib_RangeObj(PikaObj *self); +Arg* PikaStdLib_StringObj(PikaObj *self); +Arg* PikaStdLib_SysObj(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdLib_MemChecker.h b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_MemChecker.h new file mode 100644 index 00000000..7e835e6e --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_MemChecker.h @@ -0,0 +1,26 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdLib_MemChecker__H +#define __PikaStdLib_MemChecker__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdLib_MemChecker(Args *args); + +pika_float PikaStdLib_MemChecker_getMax(PikaObj *self); +pika_float PikaStdLib_MemChecker_getNow(PikaObj *self); +void PikaStdLib_MemChecker_max(PikaObj *self); +void PikaStdLib_MemChecker_now(PikaObj *self); +void PikaStdLib_MemChecker_resetMax(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdLib_RangeObj.h b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_RangeObj.h new file mode 100644 index 00000000..317f7b4c --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_RangeObj.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdLib_RangeObj__H +#define __PikaStdLib_RangeObj__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdLib_RangeObj(Args *args); + +Arg* PikaStdLib_RangeObj___next__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdLib_StringObj.h b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_StringObj.h new file mode 100644 index 00000000..290bd9f3 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_StringObj.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdLib_StringObj__H +#define __PikaStdLib_StringObj__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdLib_StringObj(Args *args); + +Arg* PikaStdLib_StringObj___next__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdLib_SysObj.h b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_SysObj.h new file mode 100644 index 00000000..d1875787 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdLib_SysObj.h @@ -0,0 +1,54 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdLib_SysObj__H +#define __PikaStdLib_SysObj__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdLib_SysObj(Args *args); + +Arg* PikaStdLib_SysObj___getitem__(PikaObj *self, Arg* obj, Arg* key); +Arg* PikaStdLib_SysObj___setitem__(PikaObj *self, Arg* obj, Arg* key, Arg* val); +PIKA_BOOL PikaStdLib_SysObj_bool(PikaObj *self, Arg* arg); +Arg* PikaStdLib_SysObj_bytes(PikaObj *self, Arg* val); +char* PikaStdLib_SysObj_cformat(PikaObj *self, char* fmt, PikaTuple* var); +char* PikaStdLib_SysObj_chr(PikaObj *self, int val); +void PikaStdLib_SysObj_clear(PikaObj *self); +Arg* PikaStdLib_SysObj_dict(PikaObj *self, PikaTuple* val); +PikaObj* PikaStdLib_SysObj_dir(PikaObj *self, Arg* obj); +Arg* PikaStdLib_SysObj_eval(PikaObj *self, char* code); +void PikaStdLib_SysObj_exec(PikaObj *self, char* code); +void PikaStdLib_SysObj_exit(PikaObj *self); +pika_float PikaStdLib_SysObj_float(PikaObj *self, Arg* arg); +void PikaStdLib_SysObj_gcdump(PikaObj *self); +Arg* PikaStdLib_SysObj_getattr(PikaObj *self, PikaObj* obj, char* name); +int PikaStdLib_SysObj_hasattr(PikaObj *self, PikaObj* obj, char* name); +void PikaStdLib_SysObj_help(PikaObj *self, char* name); +char* PikaStdLib_SysObj_hex(PikaObj *self, int val); +int PikaStdLib_SysObj_id(PikaObj *self, Arg* obj); +char* PikaStdLib_SysObj_input(PikaObj *self, PikaTuple* info); +int PikaStdLib_SysObj_int(PikaObj *self, Arg* arg); +Arg* PikaStdLib_SysObj_iter(PikaObj *self, Arg* arg); +int PikaStdLib_SysObj_len(PikaObj *self, Arg* arg); +Arg* PikaStdLib_SysObj_list(PikaObj *self, PikaTuple* val); +PikaObj* PikaStdLib_SysObj_open(PikaObj *self, char* path, char* mode); +int PikaStdLib_SysObj_ord(PikaObj *self, char* val); +void PikaStdLib_SysObj_print(PikaObj *self, PikaTuple* val, PikaDict* ops); +Arg* PikaStdLib_SysObj_range(PikaObj *self, PikaTuple* ax); +void PikaStdLib_SysObj_reboot(PikaObj *self); +void PikaStdLib_SysObj_setattr(PikaObj *self, PikaObj* obj, char* name, Arg* val); +char* PikaStdLib_SysObj_str(PikaObj *self, Arg* arg); +Arg* PikaStdLib_SysObj_tuple(PikaObj *self, Arg* arg); +Arg* PikaStdLib_SysObj_type(PikaObj *self, Arg* arg); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdTask.h b/examples/pikapython/pikapython/pikascript-api/PikaStdTask.h new file mode 100644 index 00000000..0d621eda --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdTask.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdTask__H +#define __PikaStdTask__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdTask(Args *args); + +Arg* PikaStdTask_Task(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/PikaStdTask_Task.h b/examples/pikapython/pikapython/pikascript-api/PikaStdTask_Task.h new file mode 100644 index 00000000..a4a6e360 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/PikaStdTask_Task.h @@ -0,0 +1,29 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __PikaStdTask_Task__H +#define __PikaStdTask_Task__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_PikaStdTask_Task(Args *args); + +void PikaStdTask_Task___init__(PikaObj *self); +void PikaStdTask_Task_call_always(PikaObj *self, Arg* fun_todo); +void PikaStdTask_Task_call_period_ms(PikaObj *self, Arg* fun_todo, int period_ms); +void PikaStdTask_Task_call_when(PikaObj *self, Arg* fun_todo, Arg* fun_when); +void PikaStdTask_Task_platformGetTick(PikaObj *self); +void PikaStdTask_Task_run_forever(PikaObj *self); +void PikaStdTask_Task_run_once(PikaObj *self); +void PikaStdTask_Task_run_until_ms(PikaObj *self, int until_ms); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/__asset_pikaModules_py_a.c b/examples/pikapython/pikapython/pikascript-api/__asset_pikaModules_py_a.c new file mode 100644 index 00000000..e4663ab9 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/__asset_pikaModules_py_a.c @@ -0,0 +1,998 @@ +#include "PikaPlatform.h" +/* warning: auto generated file, please do not modify */ +PIKA_BYTECODE_ALIGN const unsigned char pikaModules_py_a[] = { + 0x0f, 0x70, 0x79, 0x61, 0x8c, 0x2e, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf4, 0x00, 0x00, 0x00, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x70, 0x61, + 0x72, 0x73, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf4, 0x08, 0x00, 0x00, + 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd8, 0x0b, 0x00, 0x00, 0x6d, 0x6f, 0x64, 0x62, + 0x75, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x64, 0x0b, 0x00, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x02, 0x00, 0x00, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x48, 0x02, 0x00, 0x00, 0x65, 0x78, 0x61, 0x6d, + 0x70, 0x6c, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x30, 0x01, 0x00, 0x00, 0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x06, 0x00, 0x00, + 0x48, 0x00, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x96, 0x0c, 0x00, + 0x00, 0x96, 0x13, 0x00, 0x00, 0x96, 0x1f, 0x00, 0x00, 0x96, 0x2c, 0x00, + 0x00, 0x96, 0x37, 0x00, 0x00, 0x96, 0x40, 0x00, 0x00, 0x96, 0x49, 0x00, + 0x00, 0x96, 0x4c, 0x00, 0x00, 0x96, 0x55, 0x00, 0x00, 0x96, 0x5c, 0x00, + 0x00, 0x96, 0x61, 0x00, 0x00, 0x96, 0x6b, 0x00, 0x00, 0x96, 0x73, 0x00, + 0x00, 0x96, 0x7b, 0x00, 0x00, 0x96, 0x83, 0x00, 0x10, 0x83, 0x88, 0x00, + 0x00, 0x02, 0x9a, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x50, 0x69, 0x6b, + 0x61, 0x53, 0x74, 0x64, 0x4c, 0x69, 0x62, 0x00, 0x72, 0x61, 0x6e, 0x64, + 0x6f, 0x6d, 0x00, 0x50, 0x69, 0x6b, 0x61, 0x53, 0x74, 0x64, 0x44, 0x61, + 0x74, 0x61, 0x00, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x70, 0x61, 0x72, + 0x73, 0x65, 0x72, 0x00, 0x70, 0x69, 0x6b, 0x61, 0x5f, 0x63, 0x6a, 0x73, + 0x6f, 0x6e, 0x00, 0x50, 0x69, 0x6b, 0x61, 0x4d, 0x61, 0x74, 0x68, 0x00, + 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, 0x73, 0x74, 0x00, 0x72, 0x65, 0x00, + 0x62, 0x69, 0x6e, 0x61, 0x73, 0x63, 0x69, 0x69, 0x00, 0x6d, 0x6f, 0x64, + 0x62, 0x75, 0x73, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x70, 0x69, 0x6b, + 0x61, 0x5f, 0x6c, 0x76, 0x67, 0x6c, 0x00, 0x5f, 0x74, 0x68, 0x72, 0x65, + 0x61, 0x64, 0x00, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x00, 0x65, + 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x00, 0x6a, 0x73, 0x6f, 0x6e, 0x00, + 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x50, 0x69, 0x6b, 0x61, 0x50, 0x79, + 0x74, 0x68, 0x6f, 0x6e, 0x21, 0x00, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x30, 0x05, 0x00, 0x00, 0x00, 0x93, 0x01, 0x00, + 0x00, 0x06, 0x10, 0x00, 0x01, 0x82, 0x12, 0x00, 0x01, 0x04, 0x1a, 0x00, + 0x01, 0x91, 0x1a, 0x00, 0x01, 0x83, 0x00, 0x00, 0x01, 0x04, 0x1f, 0x00, + 0x01, 0x9c, 0x00, 0x00, 0x01, 0x04, 0x27, 0x00, 0x01, 0x89, 0x33, 0x00, + 0x01, 0x06, 0x10, 0x00, 0x12, 0x83, 0x40, 0x00, 0x12, 0x03, 0x00, 0x00, + 0x02, 0x02, 0x43, 0x00, 0x02, 0x04, 0x58, 0x00, 0x02, 0x81, 0x58, 0x00, + 0x02, 0x04, 0x1f, 0x00, 0x12, 0x83, 0x65, 0x00, 0x02, 0x02, 0x68, 0x00, + 0x02, 0x04, 0x76, 0x00, 0x12, 0x81, 0x76, 0x00, 0x02, 0x02, 0x7c, 0x00, + 0x02, 0x04, 0x81, 0x00, 0x02, 0x82, 0x85, 0x00, 0x02, 0x04, 0x92, 0x00, + 0x02, 0x0d, 0x92, 0x00, 0x02, 0x07, 0x97, 0x00, 0x13, 0x83, 0x99, 0x00, + 0x03, 0x02, 0x9b, 0x00, 0x03, 0x07, 0x10, 0x00, 0x04, 0x8f, 0x00, 0x00, + 0x13, 0x83, 0xab, 0x00, 0x03, 0x02, 0x9b, 0x00, 0x03, 0x07, 0x10, 0x00, + 0x04, 0x8f, 0x00, 0x00, 0x13, 0x83, 0xad, 0x00, 0x03, 0x02, 0x9b, 0x00, + 0x03, 0x07, 0x10, 0x00, 0x14, 0x83, 0xad, 0x00, 0x14, 0x03, 0x00, 0x00, + 0x04, 0x02, 0xaf, 0x00, 0x04, 0x04, 0xbc, 0x00, 0x14, 0x83, 0xc4, 0x00, + 0x14, 0x03, 0x00, 0x00, 0x04, 0x02, 0xc6, 0x00, 0x04, 0x04, 0xbc, 0x00, + 0x14, 0x81, 0xd6, 0x00, 0x14, 0x01, 0xbc, 0x00, 0x14, 0x1c, 0x00, 0x00, + 0x04, 0x02, 0xe7, 0x00, 0x04, 0x04, 0xd6, 0x00, 0x04, 0x8f, 0x00, 0x00, + 0x13, 0x82, 0xf3, 0x00, 0x13, 0x03, 0x00, 0x00, 0x03, 0x08, 0xfe, 0x00, + 0x03, 0x07, 0x10, 0x00, 0x04, 0x8f, 0x00, 0x00, 0x13, 0x83, 0x01, 0x01, + 0x03, 0x02, 0x03, 0x01, 0x03, 0x04, 0x0e, 0x01, 0x23, 0x81, 0x0e, 0x01, + 0x23, 0x05, 0x13, 0x01, 0x13, 0x1d, 0x00, 0x00, 0x03, 0x02, 0x15, 0x01, + 0x03, 0x04, 0x1c, 0x01, 0x23, 0x81, 0x0e, 0x01, 0x13, 0x02, 0x20, 0x01, + 0x03, 0x02, 0x15, 0x01, 0x03, 0x04, 0x2a, 0x01, 0x13, 0x81, 0xd6, 0x00, + 0x13, 0x01, 0xbc, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x03, 0x04, 0x30, 0x01, + 0x13, 0x81, 0x30, 0x01, 0x13, 0x01, 0x1c, 0x01, 0x13, 0x01, 0x2a, 0x01, + 0x03, 0x02, 0xe7, 0x00, 0x03, 0x04, 0x30, 0x01, 0x02, 0x86, 0x3d, 0x01, + 0x02, 0x8c, 0x81, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x40, 0x01, + 0x01, 0x06, 0x10, 0x00, 0x02, 0x82, 0x4f, 0x01, 0x02, 0x04, 0x65, 0x01, + 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0x72, 0x01, 0x12, 0x81, 0x65, 0x01, + 0x02, 0x02, 0x7c, 0x00, 0x02, 0x04, 0x81, 0x00, 0x02, 0x82, 0x85, 0x00, + 0x02, 0x04, 0x7b, 0x01, 0x02, 0x0d, 0x7b, 0x01, 0x02, 0x07, 0x97, 0x00, + 0x13, 0x81, 0x7b, 0x01, 0x03, 0x02, 0x88, 0x01, 0x02, 0x86, 0x3d, 0x01, + 0x02, 0x8c, 0x81, 0x00, 0x02, 0x81, 0x72, 0x01, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x98, 0x01, 0x01, 0x06, 0x10, 0x00, + 0x12, 0x81, 0xd6, 0x00, 0x12, 0x01, 0xbc, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x04, 0x30, 0x01, 0x02, 0x82, 0xae, 0x01, 0x02, 0x04, 0xc0, 0x01, + 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0xcc, 0x01, 0x12, 0x81, 0xc0, 0x01, + 0x02, 0x02, 0x7c, 0x00, 0x02, 0x04, 0x81, 0x00, 0x02, 0x82, 0x85, 0x00, + 0x02, 0x04, 0xd4, 0x01, 0x02, 0x0d, 0xd4, 0x01, 0x02, 0x07, 0x97, 0x00, + 0x13, 0x81, 0xd4, 0x01, 0x03, 0x02, 0xe0, 0x01, 0x02, 0x86, 0x3d, 0x01, + 0x02, 0x8c, 0x81, 0x00, 0x02, 0x81, 0xcc, 0x01, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xef, 0x01, 0x01, 0x06, 0x10, 0x00, + 0x12, 0x81, 0xd6, 0x00, 0x12, 0x01, 0xbc, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x04, 0x30, 0x01, 0x12, 0x81, 0x30, 0x01, 0x12, 0x01, 0x08, 0x02, + 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x0f, 0x02, 0x01, 0x06, 0x10, 0x00, 0x12, 0x81, 0xd6, 0x00, + 0x12, 0x01, 0xbc, 0x00, 0x02, 0x1d, 0x00, 0x00, 0x02, 0x04, 0x30, 0x01, + 0x12, 0x81, 0x30, 0x01, 0x12, 0x01, 0x08, 0x02, 0x12, 0x01, 0x2a, 0x01, + 0x02, 0x02, 0xe7, 0x00, 0x02, 0x04, 0x30, 0x01, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x2e, 0x02, 0x01, 0x06, 0x10, 0x00, 0x12, 0x81, 0xd6, 0x00, + 0x12, 0x01, 0x4c, 0x02, 0x12, 0x01, 0x52, 0x02, 0x02, 0x02, 0xe7, 0x00, + 0x02, 0x04, 0xd6, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x58, 0x02, + 0x01, 0x06, 0x10, 0x00, 0x12, 0x81, 0xd6, 0x00, 0x12, 0x01, 0x4c, 0x02, + 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x70, 0x02, 0x01, 0x06, 0x10, 0x00, 0x12, 0x81, 0xd6, 0x00, + 0x12, 0x01, 0xbc, 0x00, 0x02, 0x1d, 0x00, 0x00, 0x02, 0x04, 0x30, 0x01, + 0x02, 0x82, 0xae, 0x01, 0x02, 0x04, 0x65, 0x01, 0x02, 0x95, 0x00, 0x00, + 0x02, 0x04, 0x84, 0x02, 0x12, 0x81, 0x65, 0x01, 0x02, 0x02, 0x7c, 0x00, + 0x02, 0x04, 0x81, 0x00, 0x02, 0x82, 0x85, 0x00, 0x02, 0x04, 0x1c, 0x01, + 0x02, 0x0d, 0x1c, 0x01, 0x02, 0x07, 0x97, 0x00, 0x13, 0x81, 0x30, 0x01, + 0x13, 0x01, 0x1c, 0x01, 0x03, 0x1d, 0x00, 0x00, 0x03, 0x04, 0x8a, 0x02, + 0x23, 0x81, 0x1c, 0x01, 0x23, 0x01, 0x8a, 0x02, 0x13, 0x15, 0x00, 0x00, + 0x03, 0x02, 0x8e, 0x02, 0x02, 0x86, 0x3d, 0x01, 0x02, 0x8c, 0x81, 0x00, + 0x02, 0x81, 0x84, 0x02, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x9b, 0x02, 0x01, 0x06, 0x10, 0x00, 0x02, 0x83, 0x00, 0x00, + 0x02, 0x04, 0x1f, 0x00, 0x02, 0x82, 0x4f, 0x01, 0x02, 0x04, 0x65, 0x01, + 0x12, 0x81, 0x65, 0x01, 0x02, 0x02, 0x7c, 0x00, 0x02, 0x04, 0x81, 0x00, + 0x02, 0x82, 0x85, 0x00, 0x02, 0x04, 0x7b, 0x01, 0x02, 0x0d, 0x7b, 0x01, + 0x02, 0x07, 0x97, 0x00, 0x13, 0x81, 0x1f, 0x00, 0x43, 0x03, 0xad, 0x00, + 0x43, 0x01, 0x7b, 0x01, 0x33, 0x08, 0xa9, 0x02, 0x33, 0x03, 0xab, 0x02, + 0x23, 0x08, 0xa9, 0x02, 0x13, 0x02, 0x00, 0x00, 0x03, 0x08, 0xa9, 0x02, + 0x03, 0x04, 0x1f, 0x00, 0x13, 0x81, 0xd6, 0x00, 0x13, 0x01, 0x7b, 0x01, + 0x03, 0x1d, 0x00, 0x00, 0x03, 0x04, 0x30, 0x01, 0x03, 0x82, 0xae, 0x01, + 0x03, 0x04, 0x65, 0x01, 0x13, 0x81, 0x65, 0x01, 0x03, 0x02, 0x7c, 0x00, + 0x03, 0x04, 0xaf, 0x02, 0x03, 0x82, 0xb3, 0x02, 0x03, 0x04, 0x1c, 0x01, + 0x03, 0x0d, 0x1c, 0x01, 0x03, 0x07, 0x97, 0x00, 0x14, 0x81, 0x30, 0x01, + 0x14, 0x01, 0x1c, 0x01, 0x04, 0x1d, 0x00, 0x00, 0x04, 0x04, 0x8a, 0x02, + 0x14, 0x81, 0x1f, 0x00, 0x54, 0x01, 0x1c, 0x01, 0x54, 0x03, 0xc0, 0x02, + 0x44, 0x08, 0xa9, 0x02, 0x44, 0x01, 0x8a, 0x02, 0x34, 0x08, 0xa9, 0x02, + 0x34, 0x03, 0x65, 0x00, 0x24, 0x08, 0xa9, 0x02, 0x14, 0x02, 0x00, 0x00, + 0x04, 0x08, 0xa9, 0x02, 0x04, 0x04, 0x1f, 0x00, 0x03, 0x86, 0x3d, 0x01, + 0x03, 0x8c, 0xaf, 0x02, 0x13, 0x81, 0x1f, 0x00, 0x23, 0x03, 0x65, 0x00, + 0x13, 0x02, 0x00, 0x00, 0x03, 0x08, 0xa9, 0x02, 0x03, 0x04, 0x1f, 0x00, + 0x02, 0x86, 0x3d, 0x01, 0x02, 0x8c, 0x81, 0x00, 0x02, 0x81, 0x1f, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xc4, 0x02, + 0x01, 0x06, 0x10, 0x00, 0x12, 0x83, 0xda, 0x02, 0x02, 0x02, 0x00, 0x03, + 0x02, 0x81, 0x06, 0x03, 0x02, 0x19, 0x00, 0x00, 0x12, 0x81, 0x1a, 0x00, + 0x02, 0x02, 0x13, 0x03, 0x02, 0x04, 0x58, 0x00, 0x12, 0x81, 0x58, 0x00, + 0x02, 0x02, 0x00, 0x03, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x20, 0x03, + 0x01, 0x06, 0x10, 0x00, 0x02, 0x81, 0x1f, 0x00, 0x02, 0x04, 0x58, 0x00, + 0x02, 0x82, 0x3a, 0x03, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x46, 0x03, + 0x01, 0x06, 0x10, 0x00, 0x12, 0x83, 0x5b, 0x03, 0x02, 0x02, 0x00, 0x03, + 0x02, 0x81, 0x06, 0x03, 0x02, 0x19, 0x00, 0x00, 0x02, 0x83, 0x00, 0x00, + 0x02, 0x04, 0x1f, 0x00, 0x02, 0x81, 0x1f, 0x00, 0x02, 0x04, 0x58, 0x00, + 0x02, 0x82, 0x3a, 0x03, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x80, 0x03, + 0x01, 0x92, 0x1a, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x89, 0x88, 0x03, + 0x00, 0x06, 0x10, 0x00, 0x01, 0x85, 0x13, 0x01, 0x01, 0x04, 0x98, 0x03, + 0x01, 0x83, 0x00, 0x00, 0x01, 0x04, 0x8a, 0x02, 0x11, 0x81, 0x0e, 0x01, + 0x01, 0x02, 0x7c, 0x00, 0x01, 0x04, 0x9e, 0x03, 0x01, 0x82, 0xa2, 0x03, + 0x01, 0x04, 0xaf, 0x03, 0x01, 0x0d, 0xaf, 0x03, 0x01, 0x07, 0x97, 0x00, + 0x12, 0x81, 0x98, 0x03, 0x12, 0x05, 0x13, 0x01, 0x02, 0x08, 0xb4, 0x03, + 0x02, 0x07, 0x10, 0x00, 0x13, 0x81, 0x8a, 0x02, 0x13, 0x03, 0x00, 0x00, + 0x03, 0x08, 0xb6, 0x03, 0x03, 0x07, 0x10, 0x00, 0x14, 0x81, 0x8a, 0x02, + 0x44, 0x03, 0x01, 0x01, 0x44, 0x01, 0xaf, 0x03, 0x34, 0x08, 0xa9, 0x02, + 0x24, 0x02, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x04, 0x08, 0xa9, 0x02, + 0x04, 0x04, 0x8a, 0x02, 0x03, 0x8b, 0x10, 0x00, 0x14, 0x81, 0x8a, 0x02, + 0x24, 0x01, 0xaf, 0x03, 0x14, 0x02, 0x00, 0x00, 0x04, 0x08, 0xa9, 0x02, + 0x04, 0x04, 0x8a, 0x02, 0x12, 0x81, 0x98, 0x03, 0x12, 0x05, 0x10, 0x00, + 0x02, 0x08, 0xa9, 0x02, 0x02, 0x04, 0x98, 0x03, 0x01, 0x86, 0x3d, 0x01, + 0x01, 0x8c, 0x9e, 0x03, 0x01, 0x81, 0x8a, 0x02, 0x01, 0x0a, 0x00, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0xb9, 0x03, 0x00, 0x00, 0x00, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x50, 0x61, 0x72, 0x73, 0x65, 0x72, 0x28, 0x29, 0x00, + 0x31, 0x00, 0x54, 0x69, 0x6e, 0x79, 0x4f, 0x62, 0x6a, 0x00, 0x73, 0x65, + 0x6c, 0x66, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x00, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x00, 0x5f, + 0x70, 0x61, 0x72, 0x73, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, + 0x5c, 0x72, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x74, + 0x65, 0x6e, 0x74, 0x2e, 0x72, 0x65, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x00, + 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, + 0x00, 0x5c, 0x6e, 0x00, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x2e, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x73, 0x00, + 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, 0x6c, 0x32, 0x00, 0x24, 0x6c, 0x32, + 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, 0x00, 0x6c, 0x69, + 0x6e, 0x65, 0x00, 0x32, 0x00, 0x23, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x2e, + 0x73, 0x74, 0x61, 0x72, 0x74, 0x73, 0x77, 0x69, 0x74, 0x68, 0x00, 0x3b, + 0x00, 0x5b, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x72, 0x65, 0x70, 0x6c, + 0x61, 0x63, 0x65, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x00, + 0x5d, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x72, 0x65, + 0x70, 0x6c, 0x61, 0x63, 0x65, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x63, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x00, 0x5f, + 0x5f, 0x73, 0x65, 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, 0x6c, + 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x74, 0x72, 0x69, 0x70, 0x00, 0x3d, 0x3d, + 0x00, 0x3d, 0x00, 0x6c, 0x69, 0x6e, 0x65, 0x2e, 0x73, 0x70, 0x6c, 0x69, + 0x74, 0x00, 0x73, 0x74, 0x6d, 0x74, 0x00, 0x30, 0x00, 0x2e, 0x73, 0x74, + 0x72, 0x69, 0x70, 0x00, 0x6b, 0x65, 0x79, 0x00, 0x5f, 0x67, 0x65, 0x74, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, + 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x69, 0x63, 0x74, + 0x00, 0x2d, 0x31, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, + 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x2e, + 0x6b, 0x65, 0x79, 0x73, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x74, 0x65, 0x6d, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x00, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x73, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x00, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x64, 0x69, 0x63, 0x74, 0x2e, 0x6b, 0x65, 0x79, 0x73, 0x00, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6b, 0x65, 0x79, 0x73, 0x00, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x00, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x00, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x00, 0x67, + 0x65, 0x74, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x73, 0x65, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x2c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x00, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x73, 0x65, 0x74, 0x28, 0x73, + 0x65, 0x6c, 0x66, 0x2c, 0x73, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2c, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2c, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x29, 0x00, 0x5f, 0x5f, 0x73, 0x65, 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, + 0x5f, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x5f, 0x5f, 0x6b, 0x65, 0x79, + 0x2c, 0x5f, 0x5f, 0x76, 0x61, 0x6c, 0x29, 0x00, 0x5f, 0x5f, 0x6b, 0x65, + 0x79, 0x00, 0x5f, 0x5f, 0x76, 0x61, 0x6c, 0x00, 0x5f, 0x5f, 0x67, 0x65, + 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x5f, 0x5f, 0x6b, 0x65, 0x79, 0x29, 0x00, 0x69, 0x74, 0x65, 0x6d, + 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x73, 0x65, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x29, 0x00, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x00, 0x76, 0x61, + 0x6c, 0x00, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, + 0x6e, 0x64, 0x00, 0x5f, 0x5f, 0x73, 0x74, 0x72, 0x5f, 0x5f, 0x28, 0x73, + 0x65, 0x6c, 0x66, 0x29, 0x00, 0x2b, 0x00, 0x5d, 0x5c, 0x6e, 0x00, 0x24, + 0x6c, 0x33, 0x00, 0x24, 0x6c, 0x33, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x5f, 0x00, 0x20, 0x3d, 0x20, 0x00, 0x77, 0x72, 0x69, 0x74, + 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x66, 0x69, 0x6c, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, + 0x20, 0x77, 0x72, 0x69, 0x74, 0x65, 0x28, 0x29, 0x20, 0x6d, 0x65, 0x74, + 0x68, 0x6f, 0x64, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x00, 0x70, 0x72, 0x69, 0x6e, + 0x74, 0x00, 0x52, 0x75, 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x45, 0x72, 0x72, + 0x6f, 0x72, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, 0x5f, 0x73, 0x74, + 0x72, 0x5f, 0x5f, 0x00, 0x72, 0x65, 0x61, 0x64, 0x5f, 0x73, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x63, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x29, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, + 0x70, 0x61, 0x72, 0x73, 0x65, 0x00, 0x72, 0x65, 0x61, 0x64, 0x28, 0x73, + 0x65, 0x6c, 0x66, 0x2c, 0x66, 0x69, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x29, 0x00, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x3a, 0x20, 0x72, 0x65, + 0x61, 0x64, 0x28, 0x29, 0x20, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x6d, 0x65, 0x6e, + 0x74, 0x65, 0x64, 0x00, 0x24, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, + 0x5f, 0x67, 0x65, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x28, 0x73, 0x74, + 0x6d, 0x74, 0x29, 0x00, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x00, 0x24, 0x6c, + 0x31, 0x00, 0x24, 0x6c, 0x31, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, + 0x5f, 0x5f, 0x00, 0x69, 0x74, 0x65, 0x6d, 0x00, 0x3e, 0x00, 0x21, 0x3d, + 0x00, 0x00, 0x00, 0x00, 0xb8, 0x05, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, + 0x00, 0x82, 0x0c, 0x00, 0x00, 0x04, 0x22, 0x00, 0x00, 0x93, 0x26, 0x00, + 0x00, 0x06, 0x33, 0x00, 0x01, 0x82, 0x35, 0x00, 0x01, 0x04, 0x3d, 0x00, + 0x01, 0x91, 0x3d, 0x00, 0x01, 0x89, 0x42, 0x00, 0x01, 0x06, 0x33, 0x00, + 0x02, 0x85, 0x51, 0x00, 0x02, 0x04, 0x53, 0x00, 0x02, 0x85, 0x51, 0x00, + 0x02, 0x04, 0x62, 0x00, 0x02, 0x85, 0x51, 0x00, 0x02, 0x04, 0x73, 0x00, + 0x02, 0x85, 0x51, 0x00, 0x02, 0x04, 0x83, 0x00, 0x02, 0x95, 0x00, 0x00, + 0x02, 0x04, 0x91, 0x00, 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0x9d, 0x00, + 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0xab, 0x00, 0x02, 0x85, 0x51, 0x00, + 0x02, 0x04, 0xb8, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xca, 0x00, + 0x01, 0x06, 0x33, 0x00, 0x22, 0x81, 0x53, 0x00, 0x22, 0x05, 0x51, 0x00, + 0x12, 0x08, 0xde, 0x00, 0x22, 0x01, 0x62, 0x00, 0x22, 0x05, 0x51, 0x00, + 0x12, 0x08, 0xde, 0x00, 0x02, 0x08, 0xe1, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xe7, 0x00, 0x01, 0x06, 0x33, 0x00, + 0x12, 0x83, 0xf5, 0x00, 0x12, 0x01, 0x83, 0x00, 0x12, 0x01, 0x53, 0x00, + 0x12, 0x01, 0x62, 0x00, 0x12, 0x01, 0x73, 0x00, 0x02, 0x02, 0x3c, 0x01, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x44, 0x01, + 0x01, 0x92, 0x3d, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0x4c, 0x01, + 0x00, 0x06, 0x33, 0x00, 0x01, 0x82, 0x35, 0x00, 0x01, 0x04, 0x3d, 0x00, + 0x01, 0x91, 0x3d, 0x00, 0x01, 0x89, 0x57, 0x01, 0x01, 0x06, 0x33, 0x00, + 0x12, 0x83, 0x6d, 0x01, 0x12, 0x01, 0x81, 0x01, 0x12, 0x01, 0x83, 0x01, + 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, 0x22, 0x81, 0x81, 0x01, + 0x22, 0x01, 0x83, 0x01, 0x12, 0x08, 0xde, 0x00, 0x12, 0x01, 0x85, 0x01, + 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x89, 0x01, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0xa2, 0x01, 0x12, 0x01, 0x81, 0x01, + 0x12, 0x01, 0x83, 0x01, 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, + 0x22, 0x81, 0x81, 0x01, 0x22, 0x01, 0x83, 0x01, 0x12, 0x08, 0xc1, 0x01, + 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0xc4, 0x01, 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0xde, 0x01, + 0x12, 0x01, 0x81, 0x01, 0x12, 0x01, 0x83, 0x01, 0x02, 0x02, 0x3c, 0x01, + 0x02, 0x04, 0x85, 0x01, 0x22, 0x81, 0x81, 0x01, 0x22, 0x01, 0x83, 0x01, + 0x12, 0x08, 0xf9, 0x01, 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xfc, 0x01, 0x01, 0x06, 0x33, 0x00, + 0x12, 0x83, 0x19, 0x02, 0x12, 0x01, 0x81, 0x01, 0x12, 0x01, 0x83, 0x01, + 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, 0x22, 0x81, 0x81, 0x01, + 0x22, 0x01, 0x83, 0x01, 0x12, 0x08, 0x34, 0x02, 0x12, 0x01, 0x85, 0x01, + 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x37, 0x02, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0x4a, 0x02, 0x12, 0x01, 0x81, 0x01, + 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, 0x12, 0x81, 0x81, 0x01, + 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x61, 0x02, 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0x75, 0x02, + 0x12, 0x01, 0x81, 0x01, 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, + 0x22, 0x81, 0x81, 0x01, 0x12, 0x08, 0x8d, 0x02, 0x12, 0x01, 0x85, 0x01, + 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x93, 0x02, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0xa6, 0x02, 0x12, 0x01, 0x81, 0x01, + 0x12, 0x01, 0x83, 0x01, 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, + 0x22, 0x81, 0x81, 0x01, 0x22, 0x01, 0x83, 0x01, 0x12, 0x08, 0xb3, 0x02, + 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0xb8, 0x02, 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0xce, 0x02, + 0x12, 0x01, 0x81, 0x01, 0x12, 0x01, 0x83, 0x01, 0x02, 0x02, 0x3c, 0x01, + 0x02, 0x04, 0x85, 0x01, 0x32, 0x81, 0x81, 0x01, 0x22, 0x08, 0xb3, 0x02, + 0x22, 0x01, 0x83, 0x01, 0x12, 0x08, 0x8d, 0x02, 0x12, 0x01, 0x85, 0x01, + 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xd7, 0x02, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0xec, 0x02, 0x12, 0x01, 0x81, 0x01, + 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, 0x22, 0x81, 0x81, 0x01, + 0x22, 0x01, 0xfb, 0x02, 0x12, 0x08, 0xb3, 0x02, 0x12, 0x01, 0x85, 0x01, + 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x00, 0x03, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0x18, 0x03, 0x12, 0x01, 0x81, 0x01, + 0x02, 0x02, 0x3c, 0x01, 0x02, 0x04, 0x85, 0x01, 0x32, 0x81, 0x81, 0x01, + 0x22, 0x08, 0xb3, 0x02, 0x22, 0x01, 0xfb, 0x02, 0x12, 0x08, 0x8d, 0x02, + 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x23, 0x03, 0x01, 0x06, 0x33, 0x00, 0x12, 0x83, 0x36, 0x03, + 0x12, 0x01, 0x81, 0x01, 0x12, 0x01, 0x83, 0x01, 0x02, 0x02, 0x3c, 0x01, + 0x02, 0x04, 0x85, 0x01, 0x22, 0x81, 0x81, 0x01, 0x22, 0x01, 0x83, 0x01, + 0x12, 0x08, 0x4e, 0x03, 0x12, 0x01, 0x85, 0x01, 0x02, 0x1e, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x53, 0x03, 0x01, 0x06, 0x33, 0x00, + 0x22, 0x81, 0x3d, 0x00, 0x12, 0x02, 0x7a, 0x03, 0x02, 0x02, 0x7e, 0x03, + 0x02, 0x04, 0x83, 0x03, 0x02, 0x82, 0x87, 0x03, 0x02, 0x04, 0x94, 0x03, + 0x02, 0x0d, 0x94, 0x03, 0x02, 0x07, 0x99, 0x03, 0x13, 0x83, 0x9b, 0x03, + 0x03, 0x02, 0xa0, 0x03, 0x03, 0x07, 0x33, 0x00, 0x14, 0x81, 0xb0, 0x03, + 0x24, 0x05, 0x33, 0x00, 0x14, 0x02, 0x00, 0x00, 0x04, 0x08, 0xc0, 0x03, + 0x04, 0x04, 0xb0, 0x03, 0x14, 0x81, 0x3d, 0x00, 0x14, 0x01, 0x94, 0x03, + 0x04, 0x02, 0xc2, 0x03, 0x04, 0x04, 0xca, 0x03, 0x24, 0x83, 0xd7, 0x03, + 0x24, 0x01, 0xea, 0x03, 0x24, 0x01, 0x94, 0x03, 0x14, 0x02, 0x3c, 0x01, + 0x04, 0x02, 0xf5, 0x03, 0x04, 0x97, 0x00, 0x00, 0x05, 0x85, 0xfb, 0x03, + 0x05, 0x04, 0xff, 0x03, 0x05, 0x85, 0xfb, 0x03, 0x05, 0x04, 0x0a, 0x04, + 0x05, 0x82, 0x14, 0x04, 0x05, 0x04, 0xff, 0x03, 0x05, 0x82, 0xca, 0x03, + 0x05, 0x82, 0x14, 0x04, 0x05, 0x04, 0x0a, 0x04, 0x25, 0x83, 0x1f, 0x04, + 0x25, 0x01, 0xea, 0x03, 0x25, 0x01, 0x94, 0x03, 0x15, 0x02, 0x3c, 0x01, + 0x05, 0x02, 0xf5, 0x03, 0x15, 0x81, 0x0a, 0x04, 0x15, 0x01, 0xff, 0x03, + 0x05, 0x08, 0xc1, 0x01, 0x05, 0x07, 0x33, 0x00, 0x16, 0x83, 0x32, 0x04, + 0x26, 0x01, 0x0a, 0x04, 0x26, 0x01, 0xff, 0x03, 0x16, 0x08, 0x3f, 0x04, + 0x06, 0x02, 0xf5, 0x03, 0x04, 0x98, 0x00, 0x00, 0x04, 0x1a, 0x00, 0x00, + 0x04, 0x07, 0x99, 0x03, 0x04, 0x9f, 0x00, 0x00, 0x25, 0x83, 0x41, 0x04, + 0x25, 0x01, 0xea, 0x03, 0x25, 0x01, 0x94, 0x03, 0x15, 0x02, 0x3c, 0x01, + 0x05, 0x02, 0xf5, 0x03, 0x15, 0x81, 0x54, 0x04, 0x25, 0x05, 0x33, 0x00, + 0x15, 0x02, 0x00, 0x00, 0x05, 0x08, 0xc0, 0x03, 0x05, 0x04, 0x54, 0x04, + 0x02, 0x86, 0x65, 0x04, 0x02, 0x8c, 0x83, 0x03, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x91, 0x44, 0x01, 0x01, 0x92, 0x3d, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x00, 0x93, 0x68, 0x04, 0x00, 0x06, 0x33, 0x00, 0x01, 0x82, 0x35, 0x00, + 0x01, 0x04, 0x3d, 0x00, 0x01, 0x91, 0x3d, 0x00, 0x01, 0x89, 0x74, 0x04, + 0x01, 0x06, 0x33, 0x00, 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0x88, 0x04, + 0x02, 0x81, 0x94, 0x03, 0x02, 0x04, 0x94, 0x04, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x9e, 0x04, 0x01, 0x06, 0x33, 0x00, 0x12, 0x81, 0xb1, 0x04, + 0x02, 0x02, 0xb6, 0x04, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xc9, 0x04, + 0x01, 0x06, 0x33, 0x00, 0x12, 0x81, 0x88, 0x04, 0x02, 0x02, 0x7e, 0x03, + 0x02, 0x04, 0x83, 0x03, 0x02, 0x82, 0x87, 0x03, 0x02, 0x04, 0xb1, 0x04, + 0x02, 0x0d, 0xb1, 0x04, 0x02, 0x07, 0x99, 0x03, 0x13, 0x81, 0xe5, 0x04, + 0x13, 0x01, 0x94, 0x04, 0x03, 0x02, 0xec, 0x04, 0x02, 0x86, 0x65, 0x04, + 0x02, 0x8c, 0x83, 0x03, 0x02, 0x81, 0xe5, 0x04, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x44, 0x01, 0x01, 0x92, 0x3d, 0x00, + 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0xf5, 0x04, 0x00, 0x06, 0x33, 0x00, + 0x01, 0x82, 0x35, 0x00, 0x01, 0x04, 0x3d, 0x00, 0x01, 0x91, 0x3d, 0x00, + 0x01, 0x89, 0x06, 0x05, 0x01, 0x06, 0x33, 0x00, 0x02, 0x82, 0x20, 0x05, + 0x02, 0x04, 0x2b, 0x05, 0x22, 0x83, 0x2f, 0x05, 0x22, 0x01, 0x4a, 0x05, + 0x12, 0x02, 0x3c, 0x01, 0x02, 0x02, 0xf5, 0x03, 0x12, 0x81, 0x2b, 0x05, + 0x02, 0x02, 0x55, 0x05, 0x02, 0x04, 0x5f, 0x05, 0x22, 0x83, 0x61, 0x05, + 0x22, 0x01, 0x7f, 0x05, 0x12, 0x02, 0x3c, 0x01, 0x12, 0x01, 0x4a, 0x05, + 0x02, 0x02, 0xf5, 0x03, 0x12, 0x83, 0x00, 0x00, 0x02, 0x02, 0xf5, 0x03, + 0x12, 0x83, 0x8c, 0x05, 0x02, 0x02, 0xf5, 0x03, 0x22, 0x81, 0x99, 0x05, + 0x22, 0x05, 0x51, 0x00, 0x12, 0x08, 0xa9, 0x05, 0x22, 0x01, 0xab, 0x05, + 0x22, 0x05, 0x51, 0x00, 0x12, 0x08, 0xa9, 0x05, 0x02, 0x08, 0xb9, 0x05, + 0x02, 0x07, 0x33, 0x00, 0x23, 0x83, 0xbe, 0x05, 0x23, 0x01, 0xab, 0x05, + 0x23, 0x01, 0x99, 0x05, 0x13, 0x02, 0x3c, 0x01, 0x03, 0x02, 0xf5, 0x03, + 0x02, 0x8b, 0x33, 0x00, 0x03, 0x83, 0x00, 0x00, 0x03, 0x04, 0x85, 0x01, + 0x13, 0x81, 0xe4, 0x05, 0x13, 0x05, 0x51, 0x00, 0x03, 0x08, 0xa9, 0x05, + 0x03, 0x07, 0x33, 0x00, 0x14, 0x81, 0x85, 0x01, 0x34, 0x03, 0xf3, 0x05, + 0x34, 0x01, 0xe4, 0x05, 0x24, 0x02, 0x3c, 0x01, 0x14, 0x02, 0x00, 0x00, + 0x04, 0x08, 0xc0, 0x03, 0x04, 0x04, 0x85, 0x01, 0x13, 0x81, 0x85, 0x01, + 0x03, 0x02, 0xf5, 0x03, 0x23, 0x83, 0x01, 0x06, 0x23, 0x01, 0x7f, 0x05, + 0x13, 0x02, 0x3c, 0x01, 0x03, 0x02, 0xf5, 0x03, 0x02, 0x81, 0x2b, 0x05, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x44, 0x01, + 0x01, 0x92, 0x3d, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x17, 0x06, 0x00, 0x00, + 0x00, 0x50, 0x69, 0x6b, 0x61, 0x53, 0x74, 0x64, 0x4c, 0x69, 0x62, 0x00, + 0x50, 0x69, 0x6b, 0x61, 0x53, 0x74, 0x64, 0x4c, 0x69, 0x62, 0x2e, 0x4d, + 0x65, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x65, 0x72, 0x00, 0x6d, 0x65, + 0x6d, 0x00, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x28, 0x29, 0x00, 0x31, 0x00, 0x54, 0x69, 0x6e, 0x79, 0x4f, 0x62, 0x6a, + 0x00, 0x73, 0x65, 0x6c, 0x66, 0x00, 0x5f, 0x5f, 0x69, 0x6e, 0x69, 0x74, + 0x5f, 0x5f, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, 0x30, 0x00, 0x73, + 0x65, 0x6c, 0x66, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x4e, 0x75, + 0x6d, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x61, 0x69, 0x6c, 0x75, + 0x72, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, + 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x00, 0x73, + 0x65, 0x6c, 0x66, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x73, 0x52, 0x75, 0x6e, + 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, + 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, + 0x65, 0x73, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x6b, 0x69, 0x70, + 0x70, 0x65, 0x64, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, 0x6e, 0x65, + 0x77, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x00, 0x77, 0x61, + 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x66, 0x75, 0x6c, 0x28, + 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, 0x3d, 0x3d, 0x00, 0x20, 0x61, 0x6e, + 0x64, 0x20, 0x00, 0x5f, 0x5f, 0x73, 0x74, 0x72, 0x5f, 0x5f, 0x28, 0x73, + 0x65, 0x6c, 0x66, 0x29, 0x00, 0x3c, 0x75, 0x6e, 0x69, 0x74, 0x74, 0x65, + 0x73, 0x74, 0x2e, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x54, 0x65, + 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x20, 0x72, 0x75, 0x6e, + 0x3d, 0x25, 0x64, 0x2c, 0x20, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x3d, + 0x25, 0x64, 0x2c, 0x20, 0x66, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, + 0x3d, 0x25, 0x64, 0x2c, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x3d, + 0x25, 0x64, 0x3e, 0x00, 0x63, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x00, + 0x24, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, 0x54, 0x65, 0x73, 0x74, + 0x43, 0x61, 0x73, 0x65, 0x28, 0x29, 0x00, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, + 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, 0x20, 0x76, 0x73, 0x20, 0x28, + 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x29, 0x20, 0x25, 0x72, + 0x00, 0x78, 0x00, 0x79, 0x00, 0x6d, 0x73, 0x67, 0x00, 0x61, 0x73, 0x73, + 0x65, 0x72, 0x74, 0x4e, 0x6f, 0x74, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x28, + 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, + 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x65, 0x71, 0x75, 0x61, + 0x6c, 0x20, 0x25, 0x72, 0x00, 0x21, 0x3d, 0x00, 0x61, 0x73, 0x73, 0x65, + 0x72, 0x74, 0x4c, 0x65, 0x73, 0x73, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x28, + 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, + 0x20, 0x69, 0x73, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, + 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x3c, 0x3d, 0x20, 0x25, 0x72, + 0x00, 0x3c, 0x3d, 0x00, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x47, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x72, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x28, 0x73, + 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, 0x20, + 0x69, 0x73, 0x20, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, + 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x3e, 0x3d, 0x20, 0x25, 0x72, 0x00, + 0x3e, 0x3d, 0x00, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x54, 0x72, 0x75, + 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x29, 0x00, 0x45, 0x78, + 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x20, 0x25, 0x72, 0x20, 0x74, 0x6f, + 0x20, 0x62, 0x65, 0x20, 0x54, 0x72, 0x75, 0x65, 0x00, 0x61, 0x73, 0x73, + 0x65, 0x72, 0x74, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x28, 0x73, 0x65, 0x6c, + 0x66, 0x2c, 0x78, 0x29, 0x00, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, + 0x64, 0x20, 0x25, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, 0x46, + 0x61, 0x6c, 0x73, 0x65, 0x00, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x00, 0x61, + 0x73, 0x73, 0x65, 0x72, 0x74, 0x49, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, 0x20, 0x69, 0x73, 0x20, + 0x6e, 0x6f, 0x74, 0x20, 0x25, 0x72, 0x00, 0x20, 0x69, 0x73, 0x20, 0x00, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x49, 0x73, 0x4e, 0x6f, 0x74, 0x28, + 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x25, 0x72, + 0x20, 0x69, 0x73, 0x20, 0x25, 0x72, 0x00, 0x61, 0x73, 0x73, 0x65, 0x72, + 0x74, 0x49, 0x73, 0x4e, 0x6f, 0x6e, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x78, 0x29, 0x00, 0x25, 0x72, 0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, + 0x74, 0x20, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, + 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x49, 0x73, 0x4e, 0x6f, 0x74, 0x4e, + 0x6f, 0x6e, 0x65, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x78, 0x29, 0x00, + 0x25, 0x72, 0x20, 0x69, 0x73, 0x20, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x61, + 0x73, 0x73, 0x65, 0x72, 0x74, 0x49, 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x78, 0x2c, 0x79, 0x29, 0x00, 0x45, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x20, 0x25, 0x72, 0x20, 0x74, 0x6f, 0x20, 0x62, 0x65, 0x20, + 0x69, 0x6e, 0x20, 0x25, 0x72, 0x00, 0x20, 0x69, 0x6e, 0x20, 0x00, 0x72, + 0x75, 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x2c, 0x73, 0x75, 0x69, 0x74, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x29, 0x00, 0x64, 0x69, 0x72, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, + 0x6c, 0x32, 0x00, 0x24, 0x6c, 0x32, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x5f, 0x00, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x32, 0x00, 0x74, + 0x65, 0x73, 0x74, 0x00, 0x6e, 0x61, 0x6d, 0x65, 0x2e, 0x73, 0x74, 0x61, + 0x72, 0x74, 0x73, 0x77, 0x69, 0x74, 0x68, 0x00, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x73, 0x52, 0x75, 0x6e, 0x00, + 0x2b, 0x00, 0x67, 0x65, 0x74, 0x61, 0x74, 0x74, 0x72, 0x00, 0x73, 0x65, + 0x6c, 0x66, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x6e, 0x00, 0x5b, + 0x20, 0x52, 0x55, 0x4e, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x5d, 0x20, + 0x25, 0x73, 0x2e, 0x25, 0x73, 0x00, 0x73, 0x75, 0x69, 0x74, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x00, 0x30, + 0x2e, 0x30, 0x00, 0x6d, 0x65, 0x6d, 0x5f, 0x62, 0x65, 0x66, 0x6f, 0x72, + 0x65, 0x00, 0x6d, 0x65, 0x6d, 0x5f, 0x61, 0x66, 0x74, 0x65, 0x72, 0x00, + 0x6d, 0x65, 0x6d, 0x2e, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x77, 0x00, 0x5b, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x4f, 0x4b, 0x20, 0x5d, 0x20, + 0x25, 0x73, 0x2e, 0x25, 0x73, 0x00, 0x5b, 0x20, 0x4d, 0x45, 0x4d, 0x20, + 0x4c, 0x41, 0x43, 0x4b, 0x20, 0x5d, 0x00, 0x2d, 0x00, 0x5b, 0x20, 0x20, + 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x20, 0x20, 0x5d, 0x20, 0x25, 0x73, + 0x2e, 0x25, 0x73, 0x00, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x2e, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x4e, 0x75, 0x6d, 0x00, 0x2d, 0x31, 0x00, + 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, 0x74, 0x65, 0x28, 0x29, 0x00, + 0x5f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x5f, 0x28, 0x73, 0x65, 0x6c, + 0x66, 0x2c, 0x6e, 0x61, 0x6d, 0x65, 0x29, 0x00, 0x73, 0x65, 0x6c, 0x66, + 0x2e, 0x5f, 0x74, 0x65, 0x73, 0x74, 0x73, 0x00, 0x73, 0x65, 0x6c, 0x66, + 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x61, 0x64, 0x64, 0x54, 0x65, 0x73, + 0x74, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x63, 0x61, 0x73, 0x65, 0x29, + 0x00, 0x63, 0x61, 0x73, 0x65, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, + 0x74, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, + 0x00, 0x72, 0x75, 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x29, 0x00, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x00, + 0x63, 0x61, 0x73, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x00, 0x54, 0x65, 0x78, + 0x74, 0x54, 0x65, 0x73, 0x74, 0x52, 0x75, 0x6e, 0x6e, 0x65, 0x72, 0x28, + 0x29, 0x00, 0x72, 0x75, 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x73, + 0x75, 0x69, 0x74, 0x65, 0x3a, 0x54, 0x65, 0x73, 0x74, 0x53, 0x75, 0x69, + 0x74, 0x65, 0x29, 0x00, 0x54, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x00, 0x72, 0x65, 0x73, 0x00, 0x5b, 0x2d, 0x2d, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x5d, 0x20, 0x74, 0x65, 0x73, 0x74, + 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x25, 0x73, 0x00, 0x73, 0x75, + 0x69, 0x74, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x00, 0x73, 0x75, 0x69, + 0x74, 0x65, 0x2e, 0x72, 0x75, 0x6e, 0x00, 0x5f, 0x00, 0x5b, 0x2d, 0x2d, + 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x5d, 0x20, 0x25, 0x64, + 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, + 0x25, 0x73, 0x00, 0x72, 0x65, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x73, + 0x52, 0x75, 0x6e, 0x00, 0x5b, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, 0x3d, + 0x3d, 0x3d, 0x3d, 0x5d, 0x00, 0x72, 0x65, 0x73, 0x2e, 0x66, 0x61, 0x69, + 0x6c, 0x75, 0x72, 0x65, 0x73, 0x4e, 0x75, 0x6d, 0x00, 0x3e, 0x00, 0x72, + 0x65, 0x73, 0x2e, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x73, 0x4e, 0x75, 0x6d, + 0x00, 0x20, 0x6f, 0x72, 0x20, 0x00, 0x5b, 0x20, 0x20, 0x46, 0x41, 0x49, + 0x4c, 0x45, 0x44, 0x20, 0x20, 0x5d, 0x20, 0x28, 0x25, 0x64, 0x20, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x73, 0x2c, 0x20, 0x25, 0x64, 0x20, 0x66, 0x61, + 0x69, 0x6c, 0x75, 0x72, 0x65, 0x73, 0x29, 0x00, 0x72, 0x65, 0x73, 0x2e, + 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x4e, 0x75, 0x6d, 0x00, 0x20, + 0x28, 0x73, 0x6b, 0x69, 0x70, 0x70, 0x65, 0x64, 0x3d, 0x25, 0x64, 0x29, + 0x00, 0x5b, 0x20, 0x20, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x20, 0x20, + 0x5d, 0x20, 0x25, 0x64, 0x20, 0x74, 0x65, 0x73, 0x74, 0x73, 0x00, 0x00, + 0xc4, 0x05, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x93, 0x09, 0x00, + 0x00, 0x06, 0x12, 0x00, 0x01, 0x82, 0x14, 0x00, 0x01, 0x04, 0x24, 0x00, + 0x01, 0x91, 0x24, 0x00, 0x01, 0x89, 0x29, 0x00, 0x01, 0x06, 0x12, 0x00, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, 0x22, 0x01, 0x5f, 0x00, + 0x12, 0x02, 0x63, 0x00, 0x22, 0x01, 0x5f, 0x00, 0x12, 0x02, 0x67, 0x00, + 0x02, 0x02, 0x6d, 0x00, 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, + 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x97, 0x00, + 0x01, 0x06, 0x12, 0x00, 0x22, 0x85, 0xc7, 0x00, 0x32, 0x01, 0x5f, 0x00, + 0x22, 0x02, 0x63, 0x00, 0x12, 0x08, 0xc9, 0x00, 0x02, 0x02, 0x67, 0x00, + 0x02, 0x04, 0xcb, 0x00, 0x32, 0x81, 0x5f, 0x00, 0x22, 0x02, 0x63, 0x00, + 0x12, 0x02, 0xd0, 0x00, 0x02, 0x02, 0xd6, 0x00, 0x02, 0x04, 0xdb, 0x00, + 0x02, 0x82, 0xdf, 0x00, 0x02, 0x04, 0xec, 0x00, 0x02, 0x0d, 0xec, 0x00, + 0x02, 0x07, 0xc7, 0x00, 0x13, 0x81, 0xcb, 0x00, 0x23, 0x05, 0xc7, 0x00, + 0x23, 0x01, 0xec, 0x00, 0x13, 0x08, 0xc9, 0x00, 0x33, 0x01, 0x5f, 0x00, + 0x33, 0x01, 0xec, 0x00, 0x23, 0x1d, 0x00, 0x00, 0x23, 0x05, 0xee, 0x00, + 0x13, 0x08, 0xf2, 0x00, 0x03, 0x02, 0xf4, 0x00, 0x03, 0x04, 0xcb, 0x00, + 0x13, 0x81, 0xcb, 0x00, 0x33, 0x05, 0xc7, 0x00, 0x33, 0x01, 0xec, 0x00, + 0x23, 0x08, 0xc9, 0x00, 0x23, 0x05, 0x12, 0x00, 0x13, 0x08, 0x00, 0x01, + 0x33, 0x01, 0x5f, 0x00, 0x33, 0x01, 0xec, 0x00, 0x23, 0x1d, 0x00, 0x00, + 0x23, 0x05, 0xee, 0x00, 0x13, 0x08, 0x02, 0x01, 0x03, 0x02, 0xf4, 0x00, + 0x03, 0x04, 0xcb, 0x00, 0x02, 0x86, 0x05, 0x01, 0x02, 0x8c, 0xdb, 0x00, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, 0x22, 0x01, 0x5f, 0x00, + 0x12, 0x02, 0x63, 0x00, 0x12, 0x01, 0xcb, 0x00, 0x02, 0x02, 0x08, 0x01, + 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, + 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x21, 0x01, 0x01, 0x06, 0x12, 0x00, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, 0x12, 0x01, 0x49, 0x01, + 0x02, 0x02, 0x4c, 0x01, 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, + 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x5f, 0x01, + 0x01, 0x06, 0x12, 0x00, 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, + 0x12, 0x01, 0x49, 0x01, 0x02, 0x02, 0x8c, 0x01, 0x02, 0x04, 0x81, 0x00, + 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, + 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0xa4, 0x01, 0x01, 0x06, 0x12, 0x00, 0x12, 0x82, 0x54, 0x00, + 0x12, 0x01, 0x5a, 0x00, 0x12, 0x01, 0x49, 0x01, 0x02, 0x02, 0xd1, 0x01, + 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, + 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xe9, 0x01, 0x01, 0x06, 0x12, 0x00, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, 0x12, 0x01, 0x49, 0x01, + 0x02, 0x02, 0x1b, 0x02, 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, + 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x38, 0x02, + 0x01, 0x06, 0x12, 0x00, 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, + 0x12, 0x01, 0x64, 0x02, 0x02, 0x02, 0x6b, 0x02, 0x02, 0x04, 0x81, 0x00, + 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, + 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x7e, 0x02, 0x01, 0x06, 0x12, 0x00, 0x12, 0x82, 0x54, 0x00, + 0x12, 0x01, 0x5a, 0x00, 0x12, 0x01, 0xae, 0x02, 0x02, 0x02, 0xb4, 0x02, + 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, + 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xcc, 0x02, 0x01, 0x06, 0x12, 0x00, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0x5a, 0x00, 0x12, 0x01, 0x0d, 0x03, + 0x12, 0x01, 0x15, 0x03, 0x02, 0x02, 0x1c, 0x03, 0x02, 0x04, 0x81, 0x00, + 0x12, 0x81, 0x87, 0x00, 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, + 0x02, 0x1d, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x89, 0x38, 0x03, 0x01, 0x06, 0x12, 0x00, 0x12, 0x82, 0x54, 0x00, + 0x02, 0x02, 0x55, 0x03, 0x02, 0x04, 0x81, 0x00, 0x12, 0x81, 0x87, 0x00, + 0x12, 0x05, 0x95, 0x00, 0x12, 0x01, 0x81, 0x00, 0x02, 0x1d, 0x00, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x6d, 0x03, + 0x01, 0x06, 0x12, 0x00, 0x02, 0x81, 0x96, 0x03, 0x02, 0x04, 0x9a, 0x03, + 0x12, 0x82, 0x54, 0x00, 0x22, 0x01, 0x96, 0x03, 0x12, 0x02, 0x63, 0x00, + 0x02, 0x02, 0xa8, 0x03, 0x02, 0x04, 0xc2, 0x03, 0x02, 0x95, 0x00, 0x00, + 0x02, 0x04, 0xc7, 0x03, 0x22, 0x85, 0x95, 0x00, 0x32, 0x01, 0xc2, 0x03, + 0x22, 0x02, 0x63, 0x00, 0x22, 0x05, 0xc7, 0x00, 0x12, 0x02, 0xd0, 0x00, + 0x02, 0x02, 0xd6, 0x00, 0x02, 0x04, 0xdb, 0x00, 0x02, 0x82, 0xdf, 0x00, + 0x02, 0x04, 0xec, 0x00, 0x02, 0x0d, 0xec, 0x00, 0x02, 0x07, 0xc7, 0x00, + 0x43, 0x81, 0xc2, 0x03, 0x43, 0x01, 0xec, 0x00, 0x33, 0x1d, 0x00, 0x00, + 0x23, 0x02, 0xcb, 0x03, 0x53, 0x01, 0xc2, 0x03, 0x63, 0x01, 0xec, 0x00, + 0x63, 0x05, 0x12, 0x00, 0x53, 0x08, 0x00, 0x01, 0x43, 0x1d, 0x00, 0x00, + 0x33, 0x02, 0xcb, 0x03, 0x33, 0x05, 0xee, 0x00, 0x23, 0x08, 0xc9, 0x00, + 0x13, 0x08, 0x00, 0x01, 0x03, 0x02, 0xcf, 0x03, 0x02, 0x86, 0x05, 0x01, + 0x02, 0x8c, 0xdb, 0x00, 0x02, 0x81, 0xc7, 0x03, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xda, 0x03, 0x01, 0x06, 0x12, 0x00, + 0x02, 0x81, 0x96, 0x03, 0x02, 0x04, 0x9a, 0x03, 0x12, 0x81, 0x96, 0x03, + 0x02, 0x02, 0x63, 0x00, 0x02, 0x04, 0xfe, 0x03, 0x12, 0x82, 0x54, 0x00, + 0x12, 0x01, 0xfe, 0x03, 0x02, 0x02, 0x05, 0x04, 0x02, 0x04, 0xc2, 0x03, + 0x12, 0x81, 0xc2, 0x03, 0x02, 0x02, 0x1a, 0x04, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x1f, 0x04, 0x01, 0x06, 0x12, 0x00, + 0x02, 0x81, 0x96, 0x03, 0x02, 0x04, 0x9a, 0x03, 0x12, 0x81, 0x96, 0x03, + 0x02, 0x02, 0x63, 0x00, 0x02, 0x04, 0xfe, 0x03, 0x12, 0x82, 0x54, 0x00, + 0x12, 0x01, 0xfe, 0x03, 0x02, 0x02, 0x48, 0x04, 0x02, 0x04, 0xc2, 0x03, + 0x12, 0x81, 0xc2, 0x03, 0x02, 0x02, 0x1a, 0x04, 0x02, 0x0a, 0x00, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x62, 0x04, 0x01, 0x06, 0x12, 0x00, + 0x02, 0x81, 0x96, 0x03, 0x02, 0x04, 0x9a, 0x03, 0x12, 0x81, 0x96, 0x03, + 0x02, 0x02, 0x63, 0x00, 0x02, 0x04, 0xfe, 0x03, 0x12, 0x82, 0x54, 0x00, + 0x12, 0x01, 0xfe, 0x03, 0x02, 0x02, 0x90, 0x04, 0x02, 0x04, 0xc2, 0x03, + 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0xc7, 0x03, 0x22, 0x85, 0x95, 0x00, + 0x32, 0x01, 0xc2, 0x03, 0x22, 0x02, 0x63, 0x00, 0x22, 0x05, 0xc7, 0x00, + 0x12, 0x02, 0xd0, 0x00, 0x02, 0x02, 0xd6, 0x00, 0x02, 0x04, 0xdb, 0x00, + 0x02, 0x82, 0xdf, 0x00, 0x02, 0x04, 0xec, 0x00, 0x02, 0x0d, 0xec, 0x00, + 0x02, 0x07, 0xc7, 0x00, 0x43, 0x81, 0xc2, 0x03, 0x43, 0x01, 0xec, 0x00, + 0x33, 0x1d, 0x00, 0x00, 0x23, 0x02, 0xcb, 0x03, 0x53, 0x01, 0xc2, 0x03, + 0x63, 0x01, 0xec, 0x00, 0x63, 0x05, 0x12, 0x00, 0x53, 0x08, 0x00, 0x01, + 0x43, 0x1d, 0x00, 0x00, 0x33, 0x02, 0xcb, 0x03, 0x33, 0x05, 0xee, 0x00, + 0x23, 0x08, 0xc9, 0x00, 0x13, 0x08, 0x00, 0x01, 0x03, 0x02, 0xcf, 0x03, + 0x02, 0x86, 0x05, 0x01, 0x02, 0x8c, 0xdb, 0x00, 0x02, 0x81, 0xc7, 0x03, + 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xaf, 0x04, + 0x01, 0x06, 0x12, 0x00, 0x02, 0x81, 0x96, 0x03, 0x02, 0x04, 0x9a, 0x03, + 0x12, 0x81, 0x96, 0x03, 0x02, 0x02, 0x63, 0x00, 0x02, 0x04, 0xfe, 0x03, + 0x12, 0x82, 0x54, 0x00, 0x12, 0x01, 0xfe, 0x03, 0x02, 0x02, 0xe0, 0x04, + 0x02, 0x04, 0xc2, 0x03, 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0xc7, 0x03, + 0x22, 0x85, 0x95, 0x00, 0x32, 0x01, 0xc2, 0x03, 0x22, 0x02, 0x63, 0x00, + 0x22, 0x05, 0xc7, 0x00, 0x12, 0x02, 0xd0, 0x00, 0x02, 0x02, 0xd6, 0x00, + 0x02, 0x04, 0xdb, 0x00, 0x02, 0x82, 0xdf, 0x00, 0x02, 0x04, 0xec, 0x00, + 0x02, 0x0d, 0xec, 0x00, 0x02, 0x07, 0xc7, 0x00, 0x43, 0x81, 0xc2, 0x03, + 0x43, 0x01, 0xec, 0x00, 0x33, 0x1d, 0x00, 0x00, 0x23, 0x02, 0xcb, 0x03, + 0x53, 0x01, 0xc2, 0x03, 0x63, 0x01, 0xec, 0x00, 0x63, 0x05, 0x12, 0x00, + 0x53, 0x08, 0x00, 0x01, 0x43, 0x1d, 0x00, 0x00, 0x33, 0x02, 0xcb, 0x03, + 0x33, 0x05, 0xee, 0x00, 0x23, 0x08, 0xc9, 0x00, 0x13, 0x08, 0x00, 0x01, + 0x03, 0x02, 0xcf, 0x03, 0x02, 0x86, 0x05, 0x01, 0x02, 0x8c, 0xdb, 0x00, + 0x02, 0x81, 0xc7, 0x03, 0x02, 0x0a, 0x00, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x91, 0x02, 0x05, 0x01, 0x92, 0x24, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x00, 0x93, 0x0a, 0x05, 0x00, 0x06, 0x12, 0x00, 0x01, 0x82, 0x16, 0x05, + 0x01, 0x04, 0x24, 0x00, 0x01, 0x91, 0x24, 0x00, 0x01, 0x89, 0x1d, 0x05, + 0x01, 0x06, 0x12, 0x00, 0x12, 0x81, 0x4e, 0x05, 0x12, 0x01, 0x5b, 0x05, + 0x02, 0x02, 0x68, 0x05, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x02, 0x05, + 0x01, 0x92, 0x24, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0x79, 0x05, + 0x00, 0x06, 0x12, 0x00, 0x01, 0x82, 0x16, 0x05, 0x01, 0x04, 0x24, 0x00, + 0x01, 0x91, 0x24, 0x00, 0x01, 0x89, 0x1d, 0x05, 0x01, 0x06, 0x12, 0x00, + 0x12, 0x81, 0x4e, 0x05, 0x12, 0x01, 0x5b, 0x05, 0x02, 0x02, 0x85, 0x05, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x91, 0x02, 0x05, 0x01, 0x92, 0x24, 0x00, + 0x01, 0x0a, 0x00, 0x00, 0x96, 0x05, 0x00, 0x00, 0x00, 0x5f, 0x6d, 0x6f, + 0x64, 0x62, 0x75, 0x73, 0x00, 0x4d, 0x6f, 0x64, 0x42, 0x75, 0x73, 0x28, + 0x29, 0x00, 0x31, 0x00, 0x5f, 0x6d, 0x6f, 0x64, 0x62, 0x75, 0x73, 0x2e, + 0x5f, 0x4d, 0x6f, 0x64, 0x42, 0x75, 0x73, 0x00, 0x73, 0x65, 0x6c, 0x66, + 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, + 0x69, 0x74, 0x65, 0x42, 0x69, 0x74, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x73, 0x72, + 0x63, 0x3a, 0x6c, 0x69, 0x73, 0x74, 0x29, 0x00, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x00, 0x61, 0x64, 0x64, 0x72, 0x00, 0x73, 0x72, 0x63, 0x00, 0x6c, + 0x65, 0x6e, 0x00, 0x62, 0x79, 0x74, 0x65, 0x73, 0x00, 0x2e, 0x73, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x42, 0x69, 0x74, 0x73, 0x00, 0x6c, 0x65, 0x6e, 0x74, 0x68, 0x00, 0x73, + 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x65, 0x6e, 0x64, 0x42, 0x75, 0x66, 0x66, + 0x00, 0x30, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x61, 0x64, 0x64, 0x72, + 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x73, 0x72, 0x63, 0x3a, 0x6c, 0x69, 0x73, + 0x74, 0x29, 0x00, 0x32, 0x00, 0x2a, 0x00, 0x5f, 0x73, 0x72, 0x63, 0x00, + 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, + 0x6c, 0x32, 0x00, 0x24, 0x6c, 0x32, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, + 0x74, 0x5f, 0x5f, 0x00, 0x69, 0x00, 0x32, 0x35, 0x36, 0x00, 0x25, 0x00, + 0x5f, 0x5f, 0x73, 0x65, 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, + 0x2b, 0x00, 0x2f, 0x2f, 0x00, 0x2d, 0x31, 0x00, 0x2e, 0x73, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x00, 0x73, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x42, 0x69, + 0x74, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x61, 0x64, 0x64, 0x72, + 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x6e, 0x62, 0x3a, 0x69, 0x6e, 0x74, 0x29, + 0x00, 0x6e, 0x62, 0x00, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x42, 0x69, 0x74, 0x73, 0x00, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, + 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x69, 0x74, 0x73, 0x28, 0x73, 0x65, + 0x6c, 0x66, 0x2c, 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, + 0x6e, 0x62, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x2e, 0x73, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x42, 0x69, 0x74, 0x73, 0x00, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, + 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x6e, 0x62, 0x3a, + 0x69, 0x6e, 0x74, 0x29, 0x00, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, + 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x73, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x28, 0x73, 0x65, 0x6c, + 0x66, 0x2c, 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x6e, + 0x62, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x2e, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x00, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, + 0x74, 0x65, 0x42, 0x69, 0x74, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x61, + 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x73, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x00, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x42, 0x69, 0x74, 0x00, 0x73, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x28, 0x73, 0x65, 0x6c, + 0x66, 0x2c, 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x00, 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, + 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, + 0x61, 0x64, 0x64, 0x72, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x61, 0x6e, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x3a, 0x69, 0x6e, 0x74, 0x2c, 0x6f, 0x72, 0x4d, + 0x61, 0x73, 0x6b, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x61, 0x6e, 0x64, + 0x4d, 0x61, 0x73, 0x6b, 0x00, 0x6f, 0x72, 0x4d, 0x61, 0x73, 0x6b, 0x00, + 0x2e, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x4d, 0x61, + 0x73, 0x6b, 0x57, 0x72, 0x69, 0x74, 0x65, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x00, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x53, 0x6c, 0x61, 0x76, 0x65, + 0x49, 0x64, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, 0x2e, 0x73, 0x65, + 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x53, 0x6c, 0x61, 0x76, 0x65, 0x49, 0x64, 0x00, 0x64, 0x65, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x28, 0x73, 0x65, + 0x6c, 0x66, 0x2c, 0x6d, 0x73, 0x67, 0x3a, 0x62, 0x79, 0x74, 0x65, 0x73, + 0x29, 0x00, 0x6d, 0x73, 0x67, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x72, + 0x65, 0x61, 0x64, 0x42, 0x75, 0x66, 0x66, 0x00, 0x2e, 0x64, 0x65, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, + 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x00, 0x64, 0x65, + 0x73, 0x74, 0x00, 0x72, 0x65, 0x74, 0x00, 0x69, 0x6e, 0x74, 0x00, 0x72, + 0x65, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x00, 0x64, 0x65, + 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, + 0x64, 0x42, 0x69, 0x74, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x6d, + 0x73, 0x67, 0x3a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x29, 0x00, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x00, 0x2e, 0x64, 0x65, 0x73, 0x65, 0x72, 0x69, + 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x42, 0x69, 0x74, + 0x73, 0x00, 0x6c, 0x69, 0x73, 0x74, 0x00, 0x64, 0x65, 0x73, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, + 0x70, 0x75, 0x74, 0x42, 0x69, 0x74, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x6d, 0x73, 0x67, 0x3a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x29, 0x00, + 0x2e, 0x64, 0x65, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x42, 0x69, 0x74, + 0x73, 0x00, 0x64, 0x65, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, + 0x65, 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, + 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, + 0x2c, 0x6d, 0x73, 0x67, 0x3a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x29, 0x00, + 0x2e, 0x64, 0x65, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, + 0x52, 0x65, 0x61, 0x64, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x73, 0x00, 0x64, 0x65, 0x73, 0x65, 0x72, + 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, 0x65, 0x41, + 0x6e, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x73, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x6d, 0x73, 0x67, + 0x3a, 0x62, 0x79, 0x74, 0x65, 0x73, 0x29, 0x00, 0x2e, 0x64, 0x65, 0x73, + 0x65, 0x72, 0x69, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x57, 0x72, 0x69, 0x74, + 0x65, 0x41, 0x6e, 0x64, 0x52, 0x65, 0x61, 0x64, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x73, 0x00, 0x24, 0x6f, 0x72, 0x69, 0x67, 0x69, + 0x6e, 0x00, 0x4d, 0x6f, 0x64, 0x42, 0x75, 0x73, 0x52, 0x54, 0x55, 0x28, + 0x29, 0x00, 0x4d, 0x6f, 0x64, 0x42, 0x75, 0x73, 0x00, 0x5f, 0x5f, 0x69, + 0x6e, 0x69, 0x74, 0x5f, 0x5f, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, 0x73, + 0x65, 0x6e, 0x64, 0x42, 0x75, 0x66, 0x66, 0x53, 0x69, 0x7a, 0x65, 0x3a, + 0x69, 0x6e, 0x74, 0x2c, 0x72, 0x65, 0x61, 0x64, 0x42, 0x75, 0x66, 0x66, + 0x53, 0x69, 0x7a, 0x65, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x73, 0x65, + 0x6e, 0x64, 0x42, 0x75, 0x66, 0x66, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x72, + 0x65, 0x61, 0x64, 0x42, 0x75, 0x66, 0x66, 0x53, 0x69, 0x7a, 0x65, 0x00, + 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x5f, + 0x5f, 0x72, 0x74, 0x75, 0x00, 0x4d, 0x6f, 0x64, 0x42, 0x75, 0x73, 0x54, + 0x43, 0x50, 0x28, 0x29, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x5f, 0x5f, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x5f, 0x74, 0x63, 0x70, 0x00, 0x00, 0x00, + 0x30, 0x01, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x89, 0x07, 0x00, + 0x00, 0x06, 0x16, 0x00, 0x31, 0x81, 0x18, 0x00, 0x21, 0x02, 0x1a, 0x00, + 0x11, 0x02, 0x1e, 0x00, 0x01, 0x02, 0x24, 0x00, 0x01, 0x04, 0x29, 0x00, + 0x01, 0x82, 0x2d, 0x00, 0x01, 0x04, 0x3a, 0x00, 0x01, 0x0d, 0x3a, 0x00, + 0x01, 0x07, 0x3c, 0x00, 0x12, 0x85, 0x16, 0x00, 0x02, 0x02, 0x3e, 0x00, + 0x01, 0x86, 0x4c, 0x00, 0x01, 0x8c, 0x29, 0x00, 0x51, 0x81, 0x18, 0x00, + 0x61, 0x01, 0x18, 0x00, 0x51, 0x02, 0x1a, 0x00, 0x41, 0x08, 0x4f, 0x00, + 0x31, 0x02, 0x00, 0x00, 0x31, 0x05, 0x51, 0x00, 0x21, 0x08, 0x56, 0x00, + 0x11, 0x02, 0x1a, 0x00, 0x01, 0x02, 0x58, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0x67, 0x00, 0x00, 0x06, 0x16, 0x00, 0x11, 0x81, 0x18, 0x00, + 0x01, 0x02, 0x3e, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0x76, 0x00, 0x00, 0x06, 0x16, 0x00, 0x11, 0x81, 0x87, 0x00, + 0x01, 0x02, 0x58, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0x8a, 0x00, 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x91, 0x00, + 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0x9c, 0x00, + 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0xa6, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0xb4, 0x00, 0x00, 0x06, 0x16, 0x00, + 0x11, 0x81, 0xcc, 0x00, 0x01, 0x02, 0xd6, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0xe3, 0x00, 0x00, 0x06, 0x16, 0x00, + 0x11, 0x81, 0xcc, 0x00, 0x01, 0x02, 0xfe, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0x0e, 0x01, 0x00, 0x06, 0x16, 0x00, + 0x01, 0x82, 0x17, 0x01, 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0x24, 0x01, 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x2e, 0x01, + 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0x3c, 0x01, + 0x00, 0x06, 0x16, 0x00, 0x11, 0x81, 0xcc, 0x00, 0x01, 0x02, 0x53, 0x01, + 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, + 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x73, 0x6c, 0x65, 0x65, 0x70, + 0x28, 0x73, 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x00, 0x31, 0x00, + 0x73, 0x00, 0x69, 0x6e, 0x74, 0x00, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, + 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, 0x6c, 0x31, 0x00, 0x24, 0x6c, 0x31, + 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, 0x00, 0x69, 0x00, + 0x32, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x6c, 0x65, 0x65, + 0x70, 0x5f, 0x73, 0x00, 0x2d, 0x31, 0x00, 0x2d, 0x00, 0x31, 0x30, 0x30, + 0x30, 0x00, 0x2a, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x73, 0x6c, + 0x65, 0x65, 0x70, 0x5f, 0x6d, 0x73, 0x00, 0x73, 0x6c, 0x65, 0x65, 0x70, + 0x5f, 0x73, 0x28, 0x73, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x73, 0x6c, + 0x65, 0x65, 0x70, 0x5f, 0x6d, 0x73, 0x28, 0x6d, 0x73, 0x3a, 0x69, 0x6e, + 0x74, 0x29, 0x00, 0x6d, 0x73, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x29, + 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x00, + 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x28, 0x29, 0x00, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x6e, 0x73, 0x00, + 0x67, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x75, 0x6e, 0x69, 0x78, 0x5f, + 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x29, 0x00, + 0x75, 0x6e, 0x69, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x5f, 0x74, + 0x69, 0x6d, 0x65, 0x2e, 0x67, 0x6d, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x6c, + 0x6f, 0x63, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x75, 0x6e, 0x69, + 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x66, 0x6c, 0x6f, 0x61, 0x74, + 0x29, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x6c, 0x6f, 0x63, 0x61, + 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x6d, 0x6b, 0x74, 0x69, 0x6d, 0x65, + 0x28, 0x29, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x6d, 0x6b, 0x74, + 0x69, 0x6d, 0x65, 0x00, 0x61, 0x73, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x28, + 0x29, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x61, 0x73, 0x63, 0x74, + 0x69, 0x6d, 0x65, 0x00, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x28, 0x75, 0x6e, + 0x69, 0x78, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x66, 0x6c, 0x6f, 0x61, + 0x74, 0x29, 0x00, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x2e, 0x63, 0x74, 0x69, + 0x6d, 0x65, 0x00, 0x00, 0x24, 0x01, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, + 0x00, 0x93, 0x0f, 0x00, 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x18, 0x00, + 0x01, 0x04, 0x2b, 0x00, 0x01, 0x91, 0x2b, 0x00, 0x01, 0x91, 0x30, 0x00, + 0x01, 0x92, 0x2b, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0x38, 0x00, + 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x3f, 0x00, 0x01, 0x04, 0x2b, 0x00, + 0x01, 0x91, 0x2b, 0x00, 0x01, 0x91, 0x30, 0x00, 0x01, 0x92, 0x2b, 0x00, + 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0x52, 0x00, 0x00, 0x06, 0x16, 0x00, + 0x01, 0x82, 0x58, 0x00, 0x01, 0x04, 0x2b, 0x00, 0x01, 0x91, 0x2b, 0x00, + 0x01, 0x91, 0x30, 0x00, 0x01, 0x92, 0x2b, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x00, 0x93, 0x6a, 0x00, 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x70, 0x00, + 0x01, 0x04, 0x2b, 0x00, 0x01, 0x91, 0x2b, 0x00, 0x01, 0x91, 0x30, 0x00, + 0x01, 0x92, 0x2b, 0x00, 0x01, 0x0a, 0x00, 0x00, 0x00, 0x93, 0x82, 0x00, + 0x00, 0x06, 0x16, 0x00, 0x01, 0x82, 0x88, 0x00, 0x01, 0x04, 0x2b, 0x00, + 0x01, 0x91, 0x2b, 0x00, 0x01, 0x81, 0x8d, 0x00, 0x01, 0x04, 0x92, 0x00, + 0x01, 0x89, 0x96, 0x00, 0x01, 0x06, 0x16, 0x00, 0x12, 0x82, 0xac, 0x00, + 0x02, 0x02, 0xb2, 0x00, 0x12, 0x81, 0xbc, 0x00, 0x12, 0x05, 0xbf, 0x00, + 0x02, 0x08, 0xc1, 0x00, 0x02, 0x07, 0x16, 0x00, 0x03, 0x83, 0xc4, 0x00, + 0x03, 0x04, 0xc8, 0x00, 0x02, 0x8b, 0x16, 0x00, 0x12, 0x01, 0xbc, 0x00, + 0x12, 0x05, 0x16, 0x00, 0x02, 0x08, 0xc1, 0x00, 0x02, 0x07, 0x16, 0x00, + 0x03, 0x83, 0xd1, 0x00, 0x03, 0x04, 0xc8, 0x00, 0x12, 0x83, 0xd5, 0x00, + 0x02, 0x02, 0xd9, 0x00, 0x02, 0x82, 0xe6, 0x00, 0x02, 0x82, 0xf2, 0x00, + 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0xfc, 0x00, 0x01, 0x06, 0x16, 0x00, + 0x02, 0x82, 0x05, 0x01, 0x02, 0x8a, 0x00, 0x00, 0x01, 0x89, 0x0e, 0x01, + 0x01, 0x06, 0x16, 0x00, 0x02, 0x82, 0xf2, 0x00, 0x02, 0x8a, 0x00, 0x00, + 0x01, 0x91, 0x30, 0x00, 0x01, 0x92, 0x2b, 0x00, 0x01, 0x0a, 0x00, 0x00, + 0x18, 0x01, 0x00, 0x00, 0x00, 0x50, 0x69, 0x6b, 0x61, 0x53, 0x74, 0x64, + 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x00, 0x55, 0x41, 0x52, 0x54, 0x28, + 0x29, 0x00, 0x31, 0x00, 0x50, 0x69, 0x6b, 0x61, 0x53, 0x74, 0x64, 0x44, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x55, 0x41, 0x52, 0x54, 0x00, 0x73, + 0x65, 0x6c, 0x66, 0x00, 0x24, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x00, + 0x47, 0x50, 0x49, 0x4f, 0x28, 0x29, 0x00, 0x50, 0x69, 0x6b, 0x61, 0x53, + 0x74, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x47, 0x50, 0x49, + 0x4f, 0x00, 0x41, 0x44, 0x43, 0x28, 0x29, 0x00, 0x50, 0x69, 0x6b, 0x61, + 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x41, 0x44, + 0x43, 0x00, 0x44, 0x41, 0x43, 0x28, 0x29, 0x00, 0x50, 0x69, 0x6b, 0x61, + 0x53, 0x74, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x44, 0x41, + 0x43, 0x00, 0x4c, 0x45, 0x44, 0x28, 0x29, 0x00, 0x47, 0x50, 0x49, 0x4f, + 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x70, 0x69, 0x6e, 0x00, 0x5f, 0x5f, + 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x5f, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x2c, + 0x69, 0x64, 0x3a, 0x69, 0x6e, 0x74, 0x29, 0x00, 0x73, 0x75, 0x70, 0x65, + 0x72, 0x00, 0x2e, 0x5f, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x5f, 0x5f, 0x00, + 0x69, 0x64, 0x00, 0x30, 0x00, 0x3d, 0x3d, 0x00, 0x50, 0x32, 0x37, 0x00, + 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x70, 0x69, 0x6e, 0x00, 0x50, 0x32, 0x38, + 0x00, 0x6f, 0x75, 0x74, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x73, 0x65, + 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x65, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x68, + 0x69, 0x67, 0x68, 0x00, 0x6f, 0x6e, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, + 0x00, 0x73, 0x65, 0x6c, 0x66, 0x2e, 0x6c, 0x6f, 0x77, 0x00, 0x6f, 0x66, + 0x66, 0x28, 0x73, 0x65, 0x6c, 0x66, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x84, 0x00, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, 0x00, 0x96, 0x09, 0x00, + 0x00, 0x89, 0x0e, 0x00, 0x00, 0x06, 0x1a, 0x00, 0x11, 0x85, 0x1c, 0x00, + 0x01, 0x02, 0x1e, 0x00, 0x01, 0x04, 0x2a, 0x00, 0x11, 0x85, 0x1a, 0x00, + 0x01, 0x02, 0x1e, 0x00, 0x01, 0x04, 0x2f, 0x00, 0x21, 0x85, 0x34, 0x00, + 0x11, 0x02, 0x37, 0x00, 0x01, 0x02, 0x3d, 0x00, 0x01, 0x04, 0x42, 0x00, + 0x01, 0x82, 0x46, 0x00, 0x01, 0x04, 0x53, 0x00, 0x01, 0x0d, 0x53, 0x00, + 0x01, 0x07, 0x55, 0x00, 0x02, 0x82, 0x57, 0x00, 0x02, 0x82, 0x5f, 0x00, + 0x12, 0x85, 0x68, 0x00, 0x02, 0x02, 0x6c, 0x00, 0x02, 0x82, 0x77, 0x00, + 0x02, 0x82, 0x80, 0x00, 0x12, 0x85, 0x68, 0x00, 0x02, 0x02, 0x6c, 0x00, + 0x01, 0x86, 0x88, 0x00, 0x01, 0x8c, 0x42, 0x00, 0x01, 0x82, 0x77, 0x00, + 0x01, 0x82, 0x5f, 0x00, 0x01, 0x82, 0x8b, 0x00, 0x01, 0x82, 0x96, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x63, + 0x68, 0x69, 0x6e, 0x65, 0x00, 0x74, 0x69, 0x6d, 0x65, 0x00, 0x6c, 0x65, + 0x64, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x6b, 0x28, 0x29, 0x00, 0x31, 0x00, + 0x30, 0x00, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x2e, 0x4c, 0x45, + 0x44, 0x00, 0x6c, 0x65, 0x64, 0x30, 0x00, 0x6c, 0x65, 0x64, 0x31, 0x00, + 0x31, 0x30, 0x00, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x69, 0x74, 0x65, + 0x72, 0x00, 0x24, 0x6c, 0x31, 0x00, 0x24, 0x6c, 0x31, 0x2e, 0x5f, 0x5f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, 0x00, 0x69, 0x00, 0x32, 0x00, 0x6c, + 0x65, 0x64, 0x30, 0x2e, 0x6f, 0x6e, 0x00, 0x6c, 0x65, 0x64, 0x31, 0x2e, + 0x6f, 0x66, 0x66, 0x00, 0x30, 0x2e, 0x31, 0x00, 0x74, 0x69, 0x6d, 0x65, + 0x2e, 0x73, 0x6c, 0x65, 0x65, 0x70, 0x00, 0x6c, 0x65, 0x64, 0x30, 0x2e, + 0x6f, 0x66, 0x66, 0x00, 0x6c, 0x65, 0x64, 0x31, 0x2e, 0x6f, 0x6e, 0x00, + 0x2d, 0x31, 0x00, 0x6c, 0x65, 0x64, 0x30, 0x2e, 0x63, 0x6c, 0x6f, 0x73, + 0x65, 0x00, 0x6c, 0x65, 0x64, 0x31, 0x2e, 0x63, 0x6c, 0x6f, 0x73, 0x65, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x03, 0x00, 0x00, 0x00, 0x96, 0x01, 0x00, + 0x00, 0x81, 0x01, 0x00, 0x00, 0x04, 0x0c, 0x00, 0x00, 0x89, 0x12, 0x00, + 0x00, 0x06, 0x33, 0x00, 0x11, 0x81, 0x0c, 0x00, 0x11, 0x01, 0x35, 0x00, + 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, 0x02, 0x81, 0x35, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x3d, 0x00, + 0x01, 0x07, 0x33, 0x00, 0x02, 0x81, 0x35, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x4d, 0x00, 0x01, 0x07, 0x33, 0x00, + 0x02, 0x81, 0x5b, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x01, 0x02, 0x61, 0x00, 0x01, 0x07, 0x33, 0x00, 0x02, 0x81, 0x6e, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x73, 0x00, + 0x01, 0x07, 0x33, 0x00, 0x02, 0x81, 0x35, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x80, 0x00, 0x01, 0x07, 0x33, 0x00, + 0x02, 0x82, 0x8f, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x01, 0x02, 0xa4, 0x00, 0x01, 0x07, 0x33, 0x00, 0x02, 0x82, 0xb3, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0xc8, 0x00, + 0x01, 0x07, 0x33, 0x00, 0x02, 0x95, 0x00, 0x00, 0x02, 0x04, 0xd6, 0x00, + 0x22, 0x82, 0xda, 0x00, 0x12, 0x02, 0xed, 0x00, 0x02, 0x02, 0xf3, 0x00, + 0x02, 0x04, 0xf8, 0x00, 0x02, 0x82, 0xfc, 0x00, 0x02, 0x04, 0x09, 0x01, + 0x02, 0x0d, 0x09, 0x01, 0x02, 0x07, 0x0b, 0x01, 0x33, 0x81, 0x09, 0x01, + 0x23, 0x02, 0x0d, 0x01, 0x13, 0x02, 0x20, 0x01, 0x03, 0x02, 0x2e, 0x01, + 0x02, 0x86, 0x39, 0x01, 0x02, 0x8c, 0xf8, 0x00, 0x02, 0x81, 0xd6, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x3c, 0x01, + 0x01, 0x07, 0x33, 0x00, 0x02, 0x9c, 0x00, 0x00, 0x02, 0x04, 0xd6, 0x00, + 0x02, 0x82, 0x4b, 0x01, 0x02, 0x04, 0x5a, 0x01, 0x22, 0x82, 0xda, 0x00, + 0x12, 0x02, 0xed, 0x00, 0x02, 0x02, 0xf3, 0x00, 0x02, 0x04, 0xf8, 0x00, + 0x02, 0x82, 0xfc, 0x00, 0x02, 0x04, 0x09, 0x01, 0x02, 0x0d, 0x09, 0x01, + 0x02, 0x07, 0x0b, 0x01, 0x03, 0x82, 0x60, 0x01, 0x03, 0x04, 0x70, 0x01, + 0x13, 0x81, 0xd6, 0x00, 0x13, 0x01, 0x70, 0x01, 0x23, 0x01, 0x5a, 0x01, + 0x13, 0x02, 0x20, 0x01, 0x03, 0x02, 0x74, 0x01, 0x03, 0x04, 0xd6, 0x00, + 0x03, 0x82, 0x80, 0x01, 0x03, 0x04, 0x5a, 0x01, 0x02, 0x86, 0x39, 0x01, + 0x02, 0x8c, 0xf8, 0x00, 0x02, 0x81, 0xd6, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x01, 0x02, 0x8e, 0x01, 0x01, 0x07, 0x33, 0x00, + 0x02, 0x82, 0x9a, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x02, 0x81, 0x35, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0xaa, 0x01, 0x00, 0x06, 0x33, 0x00, 0x11, 0x81, 0xba, 0x01, + 0x01, 0x02, 0xbf, 0x01, 0x01, 0x04, 0xcb, 0x01, 0x11, 0x81, 0xcb, 0x01, + 0x01, 0x02, 0x20, 0x01, 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, + 0x00, 0x89, 0xce, 0x01, 0x00, 0x06, 0x33, 0x00, 0x11, 0x81, 0xe4, 0x01, + 0x11, 0x01, 0x35, 0x00, 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, + 0x02, 0x82, 0xe6, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x21, 0x01, 0xe4, 0x01, 0x11, 0x02, 0xf1, 0x01, 0x11, 0x01, 0xf6, 0x01, + 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, 0x12, 0x81, 0xe4, 0x01, + 0x02, 0x02, 0xfa, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x21, 0x01, 0xe4, 0x01, 0x11, 0x02, 0xf1, 0x01, 0x11, 0x01, 0x07, 0x02, + 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, 0x12, 0x81, 0xe4, 0x01, + 0x02, 0x02, 0xfa, 0x01, 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, + 0x21, 0x01, 0xe4, 0x01, 0x11, 0x02, 0xf1, 0x01, 0x11, 0x01, 0x0d, 0x02, + 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, 0x02, 0x81, 0xe4, 0x01, + 0x02, 0x07, 0x33, 0x00, 0x03, 0x82, 0x12, 0x02, 0x03, 0x0a, 0x00, 0x00, + 0x02, 0x8b, 0x33, 0x00, 0x03, 0x82, 0x1e, 0x02, 0x03, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x21, 0x01, 0xe4, 0x01, 0x11, 0x02, 0xf1, 0x01, + 0x11, 0x01, 0x2b, 0x02, 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, + 0x12, 0x81, 0xe4, 0x01, 0x02, 0x02, 0x2f, 0x02, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x21, 0x01, 0xe4, 0x01, 0x11, 0x02, 0xf1, 0x01, + 0x11, 0x01, 0x3c, 0x02, 0x01, 0x08, 0x3a, 0x00, 0x01, 0x07, 0x33, 0x00, + 0x02, 0x82, 0x41, 0x02, 0x02, 0x04, 0xd6, 0x00, 0x12, 0x81, 0xe4, 0x01, + 0x02, 0x02, 0xf3, 0x00, 0x02, 0x04, 0xf8, 0x00, 0x02, 0x82, 0xfc, 0x00, + 0x02, 0x04, 0x09, 0x01, 0x02, 0x0d, 0x09, 0x01, 0x02, 0x07, 0x0b, 0x01, + 0x23, 0x81, 0x09, 0x01, 0x13, 0x02, 0x4d, 0x02, 0x03, 0x02, 0x5b, 0x02, + 0x02, 0x86, 0x39, 0x01, 0x02, 0x8c, 0xf8, 0x00, 0x02, 0x81, 0xd6, 0x00, + 0x02, 0x0a, 0x00, 0x00, 0x01, 0x8b, 0x33, 0x00, 0x21, 0x01, 0xe4, 0x01, + 0x11, 0x02, 0xf1, 0x01, 0x11, 0x01, 0x6e, 0x02, 0x01, 0x08, 0x3a, 0x00, + 0x01, 0x07, 0x33, 0x00, 0x02, 0x82, 0x73, 0x02, 0x02, 0x04, 0xd6, 0x00, + 0x12, 0x82, 0x80, 0x02, 0x02, 0x02, 0xf3, 0x00, 0x02, 0x04, 0xf8, 0x00, + 0x02, 0x82, 0xfc, 0x00, 0x02, 0x04, 0x88, 0x02, 0x02, 0x0d, 0x88, 0x02, + 0x02, 0x07, 0x0b, 0x01, 0x13, 0x81, 0x88, 0x02, 0x13, 0x05, 0x8d, 0x02, + 0x03, 0x1d, 0x00, 0x00, 0x03, 0x04, 0x8f, 0x02, 0x13, 0x81, 0x88, 0x02, + 0x13, 0x05, 0x33, 0x00, 0x03, 0x1d, 0x00, 0x00, 0x03, 0x04, 0x91, 0x02, + 0x03, 0x8c, 0x88, 0x02, 0x13, 0x81, 0x8f, 0x02, 0x23, 0x01, 0x91, 0x02, + 0x13, 0x02, 0x4d, 0x02, 0x03, 0x02, 0x93, 0x02, 0x02, 0x86, 0x39, 0x01, + 0x02, 0x8c, 0xf8, 0x00, 0x02, 0x81, 0xd6, 0x00, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8b, 0x33, 0x00, 0x02, 0x82, 0xe6, 0x01, 0x02, 0x0a, 0x00, 0x00, + 0x01, 0x8a, 0x00, 0x00, 0x00, 0x89, 0xa7, 0x02, 0x00, 0x06, 0x33, 0x00, + 0x21, 0x81, 0xe4, 0x01, 0x11, 0x02, 0x4d, 0x02, 0x01, 0x02, 0xb5, 0x02, + 0x01, 0x0a, 0x00, 0x00, 0x01, 0x8a, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00, + 0x00, 0x70, 0x69, 0x6b, 0x61, 0x5f, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x00, + 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x00, 0x5f, 0x63, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x28, 0x63, 0x6a, 0x73, 0x6f, + 0x6e, 0x3a, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x63, 0x4a, 0x53, 0x4f, + 0x4e, 0x29, 0x00, 0x31, 0x00, 0x4e, 0x6f, 0x6e, 0x65, 0x00, 0x3d, 0x3d, + 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x69, 0x73, 0x49, 0x6e, 0x76, + 0x61, 0x6c, 0x69, 0x64, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x69, + 0x73, 0x46, 0x61, 0x6c, 0x73, 0x65, 0x00, 0x46, 0x61, 0x6c, 0x73, 0x65, + 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x69, 0x73, 0x54, 0x72, 0x75, + 0x65, 0x00, 0x54, 0x72, 0x75, 0x65, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x69, 0x73, 0x4e, 0x75, 0x6c, 0x6c, 0x00, 0x63, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x69, 0x73, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x00, 0x63, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x44, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x00, 0x63, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x69, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x63, + 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x63, 0x6a, 0x73, 0x6f, + 0x6e, 0x2e, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x72, 0x65, + 0x73, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x41, + 0x72, 0x72, 0x61, 0x79, 0x53, 0x69, 0x7a, 0x65, 0x00, 0x72, 0x61, 0x6e, + 0x67, 0x65, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, 0x6c, 0x32, 0x00, + 0x24, 0x6c, 0x32, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, + 0x00, 0x69, 0x00, 0x32, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x67, + 0x65, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x49, 0x74, 0x65, 0x6d, 0x00, + 0x5f, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x00, 0x72, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, + 0x00, 0x2d, 0x31, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x69, 0x73, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x67, 0x65, 0x74, 0x43, 0x68, 0x69, 0x6c, 0x64, 0x00, 0x63, 0x68, + 0x69, 0x6c, 0x64, 0x00, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x67, 0x65, + 0x74, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x6b, 0x65, 0x79, 0x00, + 0x5f, 0x5f, 0x73, 0x65, 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, + 0x63, 0x68, 0x69, 0x6c, 0x64, 0x2e, 0x67, 0x65, 0x74, 0x4e, 0x65, 0x78, + 0x74, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x69, 0x73, 0x52, 0x61, + 0x77, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x67, 0x65, 0x74, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x6c, 0x6f, 0x61, 0x64, 0x73, 0x28, + 0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x73, 0x74, 0x72, 0x29, 0x00, 0x6a, 0x73, + 0x6f, 0x6e, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x50, 0x61, 0x72, + 0x73, 0x65, 0x00, 0x63, 0x6a, 0x00, 0x5f, 0x63, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x64, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x28, 0x64, 0x3a, 0x64, 0x69, + 0x63, 0x74, 0x29, 0x00, 0x64, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, + 0x4e, 0x75, 0x6c, 0x6c, 0x00, 0x74, 0x79, 0x70, 0x65, 0x00, 0x69, 0x6e, + 0x74, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x00, 0x62, 0x6f, 0x6f, + 0x6c, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x54, 0x72, 0x75, 0x65, + 0x5f, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x46, 0x61, 0x6c, 0x73, + 0x65, 0x5f, 0x00, 0x73, 0x74, 0x72, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, + 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x00, 0x6c, 0x69, 0x73, 0x74, + 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x41, 0x72, 0x72, 0x61, 0x79, + 0x00, 0x5f, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x64, 0x65, 0x63, 0x6f, + 0x64, 0x65, 0x00, 0x72, 0x65, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x49, 0x74, + 0x65, 0x6d, 0x54, 0x6f, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x64, 0x69, + 0x63, 0x74, 0x00, 0x63, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x4f, 0x62, 0x6a, + 0x65, 0x63, 0x74, 0x00, 0x64, 0x2e, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x00, + 0x24, 0x74, 0x6d, 0x70, 0x00, 0x30, 0x00, 0x6b, 0x00, 0x76, 0x00, 0x72, + 0x65, 0x73, 0x2e, 0x61, 0x64, 0x64, 0x49, 0x74, 0x65, 0x6d, 0x54, 0x6f, + 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x00, 0x64, 0x75, 0x6d, 0x70, 0x73, + 0x28, 0x64, 0x3a, 0x64, 0x69, 0x63, 0x74, 0x29, 0x00, 0x2e, 0x70, 0x72, + 0x69, 0x6e, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; diff --git a/examples/pikapython/pikapython/pikascript-api/__pikaBinding.c b/examples/pikapython/pikapython/pikascript-api/__pikaBinding.c new file mode 100644 index 00000000..09ea2ab7 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/__pikaBinding.c @@ -0,0 +1,9687 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#include +#include +#include "BaseObj.h" +#include "PikaDebug.h" +#include "TinyObj.h" +#include "PikaDebug_Debuger.h" +#include "TinyObj.h" +#include "PikaMain.h" +#include "PikaStdLib_SysObj.h" +#include "PikaMath.h" +#include "PikaStdData.h" +#include "PikaStdDevice.h" +#include "PikaStdLib.h" +#include "_modbus.h" +#include "_thread.h" +#include "_time.h" +#include "binascii.h" +#include "pika_cjson.h" +#include "pika_lvgl.h" +#include "random.h" +#include "re.h" +#include "PikaMath.h" +#include "TinyObj.h" +#include "PikaMath_Math.h" +#include "TinyObj.h" +#include "PikaMath_Operator.h" +#include "TinyObj.h" +#include "PikaMath_Quaternion.h" +#include "TinyObj.h" +#include "PikaStdData.h" +#include "TinyObj.h" +#include "PikaStdData_ByteArray.h" +#include "TinyObj.h" +#include "PikaStdData_Dict.h" +#include "TinyObj.h" +#include "PikaStdData_FILEIO.h" +#include "TinyObj.h" +#include "PikaStdData_List.h" +#include "PikaStdData_Tuple.h" +#include "PikaStdData_String.h" +#include "TinyObj.h" +#include "PikaStdData_Tuple.h" +#include "TinyObj.h" +#include "PikaStdData_Utils.h" +#include "TinyObj.h" +#include "PikaStdData_dict_items.h" +#include "TinyObj.h" +#include "PikaStdData_dict_keys.h" +#include "TinyObj.h" +#include "PikaStdDevice.h" +#include "TinyObj.h" +#include "PikaStdDevice_ADC.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_BaseDev.h" +#include "TinyObj.h" +#include "PikaStdDevice_CAN.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_DAC.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_GPIO.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_IIC.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_PWM.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_SPI.h" +#include "PikaStdDevice_BaseDev.h" +#include "PikaStdDevice_UART.h" +#include "TinyObj.h" +#include "PikaStdLib.h" +#include "TinyObj.h" +#include "PikaStdLib_MemChecker.h" +#include "TinyObj.h" +#include "PikaStdLib_RangeObj.h" +#include "TinyObj.h" +#include "PikaStdLib_StringObj.h" +#include "TinyObj.h" +#include "PikaStdLib_SysObj.h" +#include "TinyObj.h" +#include "PikaStdTask.h" +#include "TinyObj.h" +#include "PikaStdTask_Task.h" +#include "PikaStdLib_SysObj.h" +#include "PikaStdData_List.h" +#include "_modbus.h" +#include "TinyObj.h" +#include "_modbus__ModBus.h" +#include "TinyObj.h" +#include "_thread.h" +#include "TinyObj.h" +#include "_time.h" +#include "TinyObj.h" +#include "binascii.h" +#include "TinyObj.h" +#include "pika_cjson.h" +#include "TinyObj.h" +#include "pika_cjson_Array.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_ArrayReference.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_Bool.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_False_.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_Null.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_Number.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_Object.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_ObjectReference.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_Raw.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_String.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_StringReference.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_True_.h" +#include "pika_cjson_cJSON.h" +#include "pika_cjson_cJSON.h" +#include "TinyObj.h" +#include "pika_libc.h" +#include "TinyObj.h" +#include "pika_lvgl.h" +#include "TinyObj.h" +#include "pika_lvgl_ALIGN.h" +#include "TinyObj.h" +#include "pika_lvgl_ANIM.h" +#include "TinyObj.h" +#include "pika_lvgl_EVENT.h" +#include "TinyObj.h" +#include "pika_lvgl_FLEX_ALIGN.h" +#include "TinyObj.h" +#include "pika_lvgl_FLEX_FLOW.h" +#include "TinyObj.h" +#include "pika_lvgl_LAYOUT_FLEX.h" +#include "TinyObj.h" +#include "pika_lvgl_OPA.h" +#include "TinyObj.h" +#include "pika_lvgl_PALETTE.h" +#include "TinyObj.h" +#include "pika_lvgl_SIZE.h" +#include "TinyObj.h" +#include "pika_lvgl_STATE.h" +#include "TinyObj.h" +#include "pika_lvgl_TEXT_DECOR.h" +#include "TinyObj.h" +#include "pika_lvgl_arc.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_bar.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_btn.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_checkbox.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_dropdown.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_flag_t.h" +#include "TinyObj.h" +#include "pika_lvgl_img.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_img_dsc_t.h" +#include "TinyObj.h" +#include "pika_lvgl_indev_t.h" +#include "TinyObj.h" +#include "pika_lvgl_label.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_lv_color_t.h" +#include "TinyObj.h" +#include "pika_lvgl_lv_event.h" +#include "TinyObj.h" +#include "pika_lvgl_lv_obj.h" +#include "TinyObj.h" +#include "pika_lvgl_lv_timer_t.h" +#include "TinyObj.h" +#include "pika_lvgl_obj.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_point_t.h" +#include "TinyObj.h" +#include "pika_lvgl_roller.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_slider.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_style_t.h" +#include "TinyObj.h" +#include "pika_lvgl_switch.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_table.h" +#include "pika_lvgl_lv_obj.h" +#include "pika_lvgl_textarea.h" +#include "pika_lvgl_lv_obj.h" +#include "random.h" +#include "TinyObj.h" +#include "re.h" +#include "TinyObj.h" +#include "re_Match.h" +#include "TinyObj.h" +#include "re_Pattern.h" +#include "TinyObj.h" + +#ifndef PIKA_MODULE_PIKADEBUG_DISABLE +void PikaDebug_DebugerMethod(PikaObj *self, Args *args){ + Arg* res = PikaDebug_Debuger(self); + method_returnArg(args, res); +} +method_typedef( + PikaDebug_Debuger, + "Debuger", "" +); + +class_def(PikaDebug){ + __BEFORE_MOETHOD_DEF + constructor_def(PikaDebug_Debuger, 1761613187), +}; +class_inhert(PikaDebug, TinyObj); + +PikaObj *New_PikaDebug(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaDebug); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKADEBUG_DISABLE +void PikaDebug_Debuger___init__Method(PikaObj *self, Args *args){ + PikaDebug_Debuger___init__(self); +} +method_typedef( + PikaDebug_Debuger___init__, + "__init__", "" +); + +void PikaDebug_Debuger_set_traceMethod(PikaObj *self, Args *args){ + PikaDebug_Debuger_set_trace(self); +} +method_typedef( + PikaDebug_Debuger_set_trace, + "set_trace", "" +); + +class_def(PikaDebug_Debuger){ + __BEFORE_MOETHOD_DEF + method_def(PikaDebug_Debuger___init__, 904762485), + method_def(PikaDebug_Debuger_set_trace, 1131228543), +}; +class_inhert(PikaDebug_Debuger, TinyObj); + +PikaObj *New_PikaDebug_Debuger(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaDebug_Debuger); + return self; +} + +Arg *PikaDebug_Debuger(PikaObj *self){ + return obj_newObjInPackage(New_PikaDebug_Debuger); +} +#endif + +#ifndef PIKA_MODULE_MAIN_DISABLE +class_def(PikaMain){ + __BEFORE_MOETHOD_DEF +}; +class_inhert(PikaMain, PikaStdLib_SysObj); + +PikaObj *New_PikaMain(Args *args){ + PikaObj *self = New_PikaStdLib_SysObj(args); + obj_newObj(self, "PikaMath", "PikaMath", New_PikaMath); + obj_newObj(self, "PikaStdData", "PikaStdData", New_PikaStdData); + obj_newObj(self, "PikaStdDevice", "PikaStdDevice", New_PikaStdDevice); + obj_newObj(self, "PikaStdLib", "PikaStdLib", New_PikaStdLib); + obj_newObj(self, "_modbus", "_modbus", New__modbus); + obj_newObj(self, "_thread", "_thread", New__thread); + obj_newObj(self, "_time", "_time", New__time); + obj_newObj(self, "binascii", "binascii", New_binascii); + obj_newObj(self, "pika_cjson", "pika_cjson", New_pika_cjson); + obj_newObj(self, "pika_lvgl", "pika_lvgl", New_pika_lvgl); + obj_newObj(self, "random", "random", New_random); + obj_newObj(self, "re", "re", New_re); + obj_setClass(self, PikaMain); + return self; +} + +Arg *PikaMain(PikaObj *self){ + return obj_newObjInPackage(New_PikaMain); +} +#endif + +#ifndef PIKA_MODULE_PIKAMATH_DISABLE +void PikaMath_MathMethod(PikaObj *self, Args *args){ + Arg* res = PikaMath_Math(self); + method_returnArg(args, res); +} +method_typedef( + PikaMath_Math, + "Math", "" +); + +void PikaMath_OperatorMethod(PikaObj *self, Args *args){ + Arg* res = PikaMath_Operator(self); + method_returnArg(args, res); +} +method_typedef( + PikaMath_Operator, + "Operator", "" +); + +void PikaMath_QuaternionMethod(PikaObj *self, Args *args){ + Arg* res = PikaMath_Quaternion(self); + method_returnArg(args, res); +} +method_typedef( + PikaMath_Quaternion, + "Quaternion", "" +); + +class_def(PikaMath){ + __BEFORE_MOETHOD_DEF + constructor_def(PikaMath_Operator, 90025425), + constructor_def(PikaMath_Quaternion, 337686763), + constructor_def(PikaMath_Math, 2089350319), +}; +class_inhert(PikaMath, TinyObj); + +PikaObj *New_PikaMath(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaMath); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKAMATH_DISABLE +void PikaMath_Math___init__Method(PikaObj *self, Args *args){ + PikaMath_Math___init__(self); +} +method_typedef( + PikaMath_Math___init__, + "__init__", "" +); + +void PikaMath_Math_acosMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_acos(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_acos, + "acos", "x" +); + +void PikaMath_Math_asinMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_asin(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_asin, + "asin", "x" +); + +void PikaMath_Math_atanMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_atan(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_atan, + "atan", "x" +); + +void PikaMath_Math_atan2Method(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float y = args_getFloat(args, "y"); + pika_float res = PikaMath_Math_atan2(self, x, y); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_atan2, + "atan2", "x,y" +); + +void PikaMath_Math_ceilMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + int res = PikaMath_Math_ceil(self, x); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Math_ceil, + "ceil", "x" +); + +void PikaMath_Math_cosMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_cos(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_cos, + "cos", "x" +); + +void PikaMath_Math_coshMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_cosh(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_cosh, + "cosh", "x" +); + +void PikaMath_Math_degreesMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_degrees(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_degrees, + "degrees", "x" +); + +void PikaMath_Math_expMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_exp(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_exp, + "exp", "x" +); + +void PikaMath_Math_fabsMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_fabs(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_fabs, + "fabs", "x" +); + +void PikaMath_Math_floorMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + int res = PikaMath_Math_floor(self, x); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Math_floor, + "floor", "x" +); + +void PikaMath_Math_fmodMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float y = args_getFloat(args, "y"); + pika_float res = PikaMath_Math_fmod(self, x, y); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_fmod, + "fmod", "x,y" +); + +void PikaMath_Math_logMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_log(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_log, + "log", "x" +); + +void PikaMath_Math_log10Method(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_log10(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_log10, + "log10", "x" +); + +void PikaMath_Math_log2Method(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_log2(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_log2, + "log2", "x" +); + +void PikaMath_Math_powMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float y = args_getFloat(args, "y"); + pika_float res = PikaMath_Math_pow(self, x, y); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_pow, + "pow", "x,y" +); + +void PikaMath_Math_radiansMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_radians(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_radians, + "radians", "x" +); + +void PikaMath_Math_remainderMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float y = args_getFloat(args, "y"); + pika_float res = PikaMath_Math_remainder(self, x, y); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_remainder, + "remainder", "x,y" +); + +void PikaMath_Math_sinMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_sin(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_sin, + "sin", "x" +); + +void PikaMath_Math_sinhMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_sinh(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_sinh, + "sinh", "x" +); + +void PikaMath_Math_sqrtMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_sqrt(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_sqrt, + "sqrt", "x" +); + +void PikaMath_Math_tanMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_tan(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_tan, + "tan", "x" +); + +void PikaMath_Math_tanhMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_tanh(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_tanh, + "tanh", "x" +); + +void PikaMath_Math_truncMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float res = PikaMath_Math_trunc(self, x); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Math_trunc, + "trunc", "x" +); + +class_def(PikaMath_Math){ + __BEFORE_MOETHOD_DEF + method_def(PikaMath_Math_degrees, 144734852), + method_def(PikaMath_Math_cos, 193488586), + method_def(PikaMath_Math_exp, 193491058), + method_def(PikaMath_Math_log, 193498375), + method_def(PikaMath_Math_pow, 193502747), + method_def(PikaMath_Math_sin, 193505807), + method_def(PikaMath_Math_tan, 193506632), + method_def(PikaMath_Math_atan2, 253464571), + method_def(PikaMath_Math_floor, 259122023), + method_def(PikaMath_Math_log10, 266334536), + method_def(PikaMath_Math_trunc, 275947025), + method_def(PikaMath_Math_radians, 884990407), + method_def(PikaMath_Math___init__, 904762485), + method_def(PikaMath_Math_remainder, 939143804), + method_def(PikaMath_Math_acos, 2090071083), + method_def(PikaMath_Math_asin, 2090088304), + method_def(PikaMath_Math_atan, 2090089129), + method_def(PikaMath_Math_ceil, 2090144930), + method_def(PikaMath_Math_cosh, 2090156146), + method_def(PikaMath_Math_fabs, 2090248161), + method_def(PikaMath_Math_fmod, 2090261643), + method_def(PikaMath_Math_log2, 2090479129), + method_def(PikaMath_Math_sinh, 2090724439), + method_def(PikaMath_Math_sqrt, 2090733295), + method_def(PikaMath_Math_tanh, 2090751664), +}; +class_inhert(PikaMath_Math, TinyObj); + +PikaObj *New_PikaMath_Math(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaMath_Math); + return self; +} + +Arg *PikaMath_Math(PikaObj *self){ + return obj_newObjInPackage(New_PikaMath_Math); +} +#endif + +#ifndef PIKA_MODULE_PIKAMATH_DISABLE +void PikaMath_Operator_ANDMethod(PikaObj *self, Args *args){ + int flag1 = args_getInt(args, "flag1"); + int flag2 = args_getInt(args, "flag2"); + int res = PikaMath_Operator_AND(self, flag1, flag2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_AND, + "AND", "flag1,flag2" +); + +void PikaMath_Operator_NOTMethod(PikaObj *self, Args *args){ + int flag = args_getInt(args, "flag"); + int res = PikaMath_Operator_NOT(self, flag); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_NOT, + "NOT", "flag" +); + +void PikaMath_Operator_ORMethod(PikaObj *self, Args *args){ + int flag1 = args_getInt(args, "flag1"); + int flag2 = args_getInt(args, "flag2"); + int res = PikaMath_Operator_OR(self, flag1, flag2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_OR, + "OR", "flag1,flag2" +); + +void PikaMath_Operator___del__Method(PikaObj *self, Args *args){ + PikaMath_Operator___del__(self); +} +method_typedef( + PikaMath_Operator___del__, + "__del__", "" +); + +void PikaMath_Operator___str__Method(PikaObj *self, Args *args){ + char* res = PikaMath_Operator___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaMath_Operator___str__, + "__str__", "" +); + +void PikaMath_Operator_equalFloatMethod(PikaObj *self, Args *args){ + pika_float num1 = args_getFloat(args, "num1"); + pika_float num2 = args_getFloat(args, "num2"); + int res = PikaMath_Operator_equalFloat(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_equalFloat, + "equalFloat", "num1,num2" +); + +void PikaMath_Operator_equalIntMethod(PikaObj *self, Args *args){ + int num1 = args_getInt(args, "num1"); + int num2 = args_getInt(args, "num2"); + int res = PikaMath_Operator_equalInt(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_equalInt, + "equalInt", "num1,num2" +); + +void PikaMath_Operator_graterThanFloatMethod(PikaObj *self, Args *args){ + pika_float num1 = args_getFloat(args, "num1"); + pika_float num2 = args_getFloat(args, "num2"); + int res = PikaMath_Operator_graterThanFloat(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_graterThanFloat, + "graterThanFloat", "num1,num2" +); + +void PikaMath_Operator_graterThanIntMethod(PikaObj *self, Args *args){ + int num1 = args_getInt(args, "num1"); + int num2 = args_getInt(args, "num2"); + int res = PikaMath_Operator_graterThanInt(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_graterThanInt, + "graterThanInt", "num1,num2" +); + +void PikaMath_Operator_lessThanFloatMethod(PikaObj *self, Args *args){ + pika_float num1 = args_getFloat(args, "num1"); + pika_float num2 = args_getFloat(args, "num2"); + int res = PikaMath_Operator_lessThanFloat(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_lessThanFloat, + "lessThanFloat", "num1,num2" +); + +void PikaMath_Operator_lessThanIntMethod(PikaObj *self, Args *args){ + int num1 = args_getInt(args, "num1"); + int num2 = args_getInt(args, "num2"); + int res = PikaMath_Operator_lessThanInt(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_lessThanInt, + "lessThanInt", "num1,num2" +); + +void PikaMath_Operator_minusFloatMethod(PikaObj *self, Args *args){ + pika_float num1 = args_getFloat(args, "num1"); + pika_float num2 = args_getFloat(args, "num2"); + pika_float res = PikaMath_Operator_minusFloat(self, num1, num2); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Operator_minusFloat, + "minusFloat", "num1,num2" +); + +void PikaMath_Operator_minusIntMethod(PikaObj *self, Args *args){ + int num1 = args_getInt(args, "num1"); + int num2 = args_getInt(args, "num2"); + int res = PikaMath_Operator_minusInt(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_minusInt, + "minusInt", "num1,num2" +); + +void PikaMath_Operator_plusFloatMethod(PikaObj *self, Args *args){ + pika_float num1 = args_getFloat(args, "num1"); + pika_float num2 = args_getFloat(args, "num2"); + pika_float res = PikaMath_Operator_plusFloat(self, num1, num2); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Operator_plusFloat, + "plusFloat", "num1,num2" +); + +void PikaMath_Operator_plusIntMethod(PikaObj *self, Args *args){ + int num1 = args_getInt(args, "num1"); + int num2 = args_getInt(args, "num2"); + int res = PikaMath_Operator_plusInt(self, num1, num2); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Operator_plusInt, + "plusInt", "num1,num2" +); + +class_def(PikaMath_Operator){ + __BEFORE_MOETHOD_DEF + method_def(PikaMath_Operator_OR, 5862598), + method_def(PikaMath_Operator_AND, 193450424), + method_def(PikaMath_Operator_NOT, 193464630), + method_def(PikaMath_Operator_minusInt, 796579292), + method_def(PikaMath_Operator_plusInt, 900521332), + method_def(PikaMath_Operator_graterThanFloat, 1027140939), + method_def(PikaMath_Operator_equalInt, 1143238792), + method_def(PikaMath_Operator_plusFloat, 1411555295), + method_def(PikaMath_Operator_lessThanFloat, 1453828157), + method_def(PikaMath_Operator_equalFloat, 1590380531), + method_def(PikaMath_Operator_graterThanInt, 1807278048), + method_def(PikaMath_Operator_lessThanInt, 2012755538), + method_def(PikaMath_Operator_minusFloat, 2035307079), + method_def(PikaMath_Operator___del__, 2038499702), + method_def(PikaMath_Operator___str__, 2056834106), +}; +class_inhert(PikaMath_Operator, TinyObj); + +PikaObj *New_PikaMath_Operator(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaMath_Operator); + return self; +} + +Arg *PikaMath_Operator(PikaObj *self){ + return obj_newObjInPackage(New_PikaMath_Operator); +} +#endif + +#ifndef PIKA_MODULE_PIKAMATH_DISABLE +void PikaMath_Quaternion___init__Method(PikaObj *self, Args *args){ + PikaMath_Quaternion___init__(self); +} +method_typedef( + PikaMath_Quaternion___init__, + "__init__", "" +); + +void PikaMath_Quaternion_addMethod(PikaObj *self, Args *args){ + PikaObj* quat = args_getPtr(args, "quat"); + PikaMath_Quaternion_add(self, quat); +} +method_typedef( + PikaMath_Quaternion_add, + "add", "quat" +); + +void PikaMath_Quaternion_crossproductMethod(PikaObj *self, Args *args){ + PikaObj* quat = args_getPtr(args, "quat"); + PikaMath_Quaternion_crossproduct(self, quat); +} +method_typedef( + PikaMath_Quaternion_crossproduct, + "crossproduct", "quat" +); + +void PikaMath_Quaternion_dotMethod(PikaObj *self, Args *args){ + PikaObj* quat = args_getPtr(args, "quat"); + pika_float res = PikaMath_Quaternion_dot(self, quat); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Quaternion_dot, + "dot", "quat" +); + +void PikaMath_Quaternion_fromEulerMethod(PikaObj *self, Args *args){ + pika_float yaw = args_getFloat(args, "yaw"); + pika_float pitch = args_getFloat(args, "pitch"); + pika_float roll = args_getFloat(args, "roll"); + int mode = args_getInt(args, "mode"); + PikaMath_Quaternion_fromEuler(self, yaw, pitch, roll, mode); +} +method_typedef( + PikaMath_Quaternion_fromEuler, + "fromEuler", "yaw,pitch,roll,mode" +); + +void PikaMath_Quaternion_getMethod(PikaObj *self, Args *args){ + int key = args_getInt(args, "key"); + pika_float res = PikaMath_Quaternion_get(self, key); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Quaternion_get, + "get", "key" +); + +void PikaMath_Quaternion_inverseMethod(PikaObj *self, Args *args){ + PikaMath_Quaternion_inverse(self); +} +method_typedef( + PikaMath_Quaternion_inverse, + "inverse", "" +); + +void PikaMath_Quaternion_isnormalizeMethod(PikaObj *self, Args *args){ + int res = PikaMath_Quaternion_isnormalize(self); + method_returnInt(args, res); +} +method_typedef( + PikaMath_Quaternion_isnormalize, + "isnormalize", "" +); + +void PikaMath_Quaternion_magnitudedMethod(PikaObj *self, Args *args){ + pika_float res = PikaMath_Quaternion_magnituded(self); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Quaternion_magnituded, + "magnituded", "" +); + +void PikaMath_Quaternion_magnitudedsquareMethod(PikaObj *self, Args *args){ + pika_float res = PikaMath_Quaternion_magnitudedsquare(self); + method_returnFloat(args, res); +} +method_typedef( + PikaMath_Quaternion_magnitudedsquare, + "magnitudedsquare", "" +); + +void PikaMath_Quaternion_mulMethod(PikaObj *self, Args *args){ + PikaObj* quat = args_getPtr(args, "quat"); + PikaMath_Quaternion_mul(self, quat); +} +method_typedef( + PikaMath_Quaternion_mul, + "mul", "quat" +); + +void PikaMath_Quaternion_normalizeMethod(PikaObj *self, Args *args){ + PikaMath_Quaternion_normalize(self); +} +method_typedef( + PikaMath_Quaternion_normalize, + "normalize", "" +); + +void PikaMath_Quaternion_reverseMethod(PikaObj *self, Args *args){ + PikaMath_Quaternion_reverse(self); +} +method_typedef( + PikaMath_Quaternion_reverse, + "reverse", "" +); + +void PikaMath_Quaternion_setMethod(PikaObj *self, Args *args){ + pika_float x = args_getFloat(args, "x"); + pika_float y = args_getFloat(args, "y"); + pika_float z = args_getFloat(args, "z"); + pika_float w = args_getFloat(args, "w"); + PikaMath_Quaternion_set(self, x, y, z, w); +} +method_typedef( + PikaMath_Quaternion_set, + "set", "x,y,z,w" +); + +void PikaMath_Quaternion_subMethod(PikaObj *self, Args *args){ + PikaObj* quat = args_getPtr(args, "quat"); + PikaMath_Quaternion_sub(self, quat); +} +method_typedef( + PikaMath_Quaternion_sub, + "sub", "quat" +); + +void PikaMath_Quaternion_toEulerMethod(PikaObj *self, Args *args){ + PikaObj* res = PikaMath_Quaternion_toEuler(self); + method_returnObj(args, res); +} +method_typedef( + PikaMath_Quaternion_toEuler, + "toEuler", "" +); + +class_def(PikaMath_Quaternion){ + __BEFORE_MOETHOD_DEF + method_def(PikaMath_Quaternion_add, 193486030), + method_def(PikaMath_Quaternion_dot, 193489676), + method_def(PikaMath_Quaternion_get, 193492613), + method_def(PikaMath_Quaternion_mul, 193499667), + method_def(PikaMath_Quaternion_set, 193505681), + method_def(PikaMath_Quaternion_sub, 193506191), + method_def(PikaMath_Quaternion_inverse, 529178529), + method_def(PikaMath_Quaternion_crossproduct, 529468080), + method_def(PikaMath_Quaternion_magnituded, 817488071), + method_def(PikaMath_Quaternion___init__, 904762485), + method_def(PikaMath_Quaternion_isnormalize, 972871794), + method_def(PikaMath_Quaternion_normalize, 1021972918), + method_def(PikaMath_Quaternion_reverse, 1062753473), + method_def(PikaMath_Quaternion_toEuler, 1832017573), + method_def(PikaMath_Quaternion_fromEuler, 1961336182), + method_def(PikaMath_Quaternion_magnitudedsquare, 2007433048), +}; +class_inhert(PikaMath_Quaternion, TinyObj); + +PikaObj *New_PikaMath_Quaternion(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaMath_Quaternion); + return self; +} + +Arg *PikaMath_Quaternion(PikaObj *self){ + return obj_newObjInPackage(New_PikaMath_Quaternion); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_ByteArrayMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_ByteArray(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_ByteArray, + "ByteArray", "" +); + +void PikaStdData_DictMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Dict(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Dict, + "Dict", "" +); + +void PikaStdData_FILEIOMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_FILEIO(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_FILEIO, + "FILEIO", "" +); + +void PikaStdData_ListMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_List(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_List, + "List", "" +); + +void PikaStdData_StringMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_String(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_String, + "String", "" +); + +void PikaStdData_TupleMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Tuple(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Tuple, + "Tuple", "" +); + +void PikaStdData_UtilsMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Utils(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Utils, + "Utils", "" +); + +void PikaStdData_dict_itemsMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_items(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_items, + "dict_items", "" +); + +void PikaStdData_dict_keysMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_keys(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_keys, + "dict_keys", "" +); + +class_def(PikaStdData){ + __BEFORE_MOETHOD_DEF + constructor_def(PikaStdData_Tuple, 238099855), + constructor_def(PikaStdData_Utils, 239242230), + constructor_def(PikaStdData_FILEIO, 813431197), + constructor_def(PikaStdData_dict_keys, 872966404), + constructor_def(PikaStdData_dict_items, 888749258), + constructor_def(PikaStdData_String, 1374591964), + constructor_def(PikaStdData_ByteArray, 1998882840), + constructor_def(PikaStdData_Dict, 2089035049), + constructor_def(PikaStdData_List, 2089323073), +}; +class_inhert(PikaStdData, TinyObj); + +PikaObj *New_PikaStdData(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_ByteArray___getitem__Method(PikaObj *self, Args *args){ + int __key = args_getInt(args, "__key"); + int res = PikaStdData_ByteArray___getitem__(self, __key); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_ByteArray___getitem__, + "__getitem__", "__key" +); + +void PikaStdData_ByteArray___init__Method(PikaObj *self, Args *args){ + Arg* bytes = args_getArg(args, "bytes"); + PikaStdData_ByteArray___init__(self, bytes); +} +method_typedef( + PikaStdData_ByteArray___init__, + "__init__", "bytes" +); + +void PikaStdData_ByteArray___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_ByteArray___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_ByteArray___iter__, + "__iter__", "" +); + +void PikaStdData_ByteArray___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_ByteArray___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_ByteArray___next__, + "__next__", "" +); + +void PikaStdData_ByteArray___setitem__Method(PikaObj *self, Args *args){ + int __key = args_getInt(args, "__key"); + int __val = args_getInt(args, "__val"); + PikaStdData_ByteArray___setitem__(self, __key, __val); +} +method_typedef( + PikaStdData_ByteArray___setitem__, + "__setitem__", "__key,__val" +); + +void PikaStdData_ByteArray___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_ByteArray___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_ByteArray___str__, + "__str__", "" +); + +void PikaStdData_ByteArray_decodeMethod(PikaObj *self, Args *args){ + char* res = PikaStdData_ByteArray_decode(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_ByteArray_decode, + "decode", "" +); + +class_def(PikaStdData_ByteArray){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_ByteArray___init__, 904762485), + method_def(PikaStdData_ByteArray___iter__, 911732085), + method_def(PikaStdData_ByteArray___next__, 1090305216), + method_def(PikaStdData_ByteArray___setitem__, 1364865276), + method_def(PikaStdData_ByteArray___getitem__, 1535436016), + method_def(PikaStdData_ByteArray_decode, 2021571977), + method_def(PikaStdData_ByteArray___str__, 2056834106), +}; +class_inhert(PikaStdData_ByteArray, TinyObj); + +PikaObj *New_PikaStdData_ByteArray(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_ByteArray); + return self; +} + +Arg *PikaStdData_ByteArray(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_ByteArray); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_Dict___contains__Method(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + int res = PikaStdData_Dict___contains__(self, val); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_Dict___contains__, + "__contains__", "val" +); + +void PikaStdData_Dict___del__Method(PikaObj *self, Args *args){ + PikaStdData_Dict___del__(self); +} +method_typedef( + PikaStdData_Dict___del__, + "__del__", "" +); + +void PikaStdData_Dict___getitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* res = PikaStdData_Dict___getitem__(self, __key); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Dict___getitem__, + "__getitem__", "__key" +); + +void PikaStdData_Dict___init__Method(PikaObj *self, Args *args){ + PikaStdData_Dict___init__(self); +} +method_typedef( + PikaStdData_Dict___init__, + "__init__", "" +); + +void PikaStdData_Dict___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Dict___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Dict___iter__, + "__iter__", "" +); + +void PikaStdData_Dict___len__Method(PikaObj *self, Args *args){ + int res = PikaStdData_Dict___len__(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_Dict___len__, + "__len__", "" +); + +void PikaStdData_Dict___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Dict___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Dict___next__, + "__next__", "" +); + +void PikaStdData_Dict___setitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* __val = args_getArg(args, "__val"); + PikaStdData_Dict___setitem__(self, __key, __val); +} +method_typedef( + PikaStdData_Dict___setitem__, + "__setitem__", "__key,__val" +); + +void PikaStdData_Dict___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_Dict___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_Dict___str__, + "__str__", "" +); + +void PikaStdData_Dict_getMethod(PikaObj *self, Args *args){ + char* key = args_getStr(args, "key"); + Arg* res = PikaStdData_Dict_get(self, key); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Dict_get, + "get", "key" +); + +void PikaStdData_Dict_itemsMethod(PikaObj *self, Args *args){ + PikaObj* res = PikaStdData_Dict_items(self); + method_returnObj(args, res); +} +method_typedef( + PikaStdData_Dict_items, + "items", "" +); + +void PikaStdData_Dict_keysMethod(PikaObj *self, Args *args){ + PikaObj* res = PikaStdData_Dict_keys(self); + method_returnObj(args, res); +} +method_typedef( + PikaStdData_Dict_keys, + "keys", "" +); + +void PikaStdData_Dict_removeMethod(PikaObj *self, Args *args){ + char* key = args_getStr(args, "key"); + PikaStdData_Dict_remove(self, key); +} +method_typedef( + PikaStdData_Dict_remove, + "remove", "key" +); + +void PikaStdData_Dict_setMethod(PikaObj *self, Args *args){ + char* key = args_getStr(args, "key"); + Arg* arg = args_getArg(args, "arg"); + PikaStdData_Dict_set(self, key, arg); +} +method_typedef( + PikaStdData_Dict_set, + "set", "key,arg" +); + +void PikaStdData_Dict_updateMethod(PikaObj *self, Args *args){ + PikaObj* other = args_getPtr(args, "other"); + PikaStdData_Dict_update(self, other); +} +method_typedef( + PikaStdData_Dict_update, + "update", "other" +); + +class_def(PikaStdData_Dict){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_Dict_get, 193492613), + method_def(PikaStdData_Dict_set, 193505681), + method_def(PikaStdData_Dict_items, 262956327), + method_def(PikaStdData_Dict_remove, 422343795), + method_def(PikaStdData_Dict_update, 552456360), + method_def(PikaStdData_Dict___init__, 904762485), + method_def(PikaStdData_Dict___iter__, 911732085), + method_def(PikaStdData_Dict___next__, 1090305216), + method_def(PikaStdData_Dict___setitem__, 1364865276), + method_def(PikaStdData_Dict___getitem__, 1535436016), + method_def(PikaStdData_Dict___contains__, 1644201824), + method_def(PikaStdData_Dict___del__, 2038499702), + method_def(PikaStdData_Dict___len__, 2047989248), + method_def(PikaStdData_Dict___str__, 2056834106), + method_def(PikaStdData_Dict_keys, 2090432961), +}; +class_inhert(PikaStdData_Dict, TinyObj); + +PikaObj *New_PikaStdData_Dict(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_Dict); + return self; +} + +Arg *PikaStdData_Dict(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_Dict); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_FILEIO_closeMethod(PikaObj *self, Args *args){ + PikaStdData_FILEIO_close(self); +} +method_typedef( + PikaStdData_FILEIO_close, + "close", "" +); + +void PikaStdData_FILEIO_initMethod(PikaObj *self, Args *args){ + char* path = args_getStr(args, "path"); + char* mode = args_getStr(args, "mode"); + int res = PikaStdData_FILEIO_init(self, path, mode); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_FILEIO_init, + "init", "path,mode" +); + +void PikaStdData_FILEIO_readMethod(PikaObj *self, Args *args){ + PikaTuple* size = args_getTuple(args, "size"); + Arg* res = PikaStdData_FILEIO_read(self, size); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_FILEIO_read, + "read", "*size" +); + +void PikaStdData_FILEIO_readlineMethod(PikaObj *self, Args *args){ + char* res = PikaStdData_FILEIO_readline(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_FILEIO_readline, + "readline", "" +); + +void PikaStdData_FILEIO_readlinesMethod(PikaObj *self, Args *args){ + PikaObj* res = PikaStdData_FILEIO_readlines(self); + method_returnObj(args, res); +} +method_typedef( + PikaStdData_FILEIO_readlines, + "readlines", "" +); + +void PikaStdData_FILEIO_seekMethod(PikaObj *self, Args *args){ + int offset = args_getInt(args, "offset"); + PikaTuple* fromwhere = args_getTuple(args, "fromwhere"); + int res = PikaStdData_FILEIO_seek(self, offset, fromwhere); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_FILEIO_seek, + "seek", "offset,*fromwhere" +); + +void PikaStdData_FILEIO_tellMethod(PikaObj *self, Args *args){ + int res = PikaStdData_FILEIO_tell(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_FILEIO_tell, + "tell", "" +); + +void PikaStdData_FILEIO_writeMethod(PikaObj *self, Args *args){ + Arg* s = args_getArg(args, "s"); + int res = PikaStdData_FILEIO_write(self, s); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_FILEIO_write, + "write", "s" +); + +void PikaStdData_FILEIO_writelinesMethod(PikaObj *self, Args *args){ + PikaObj* lines = args_getPtr(args, "lines"); + PikaStdData_FILEIO_writelines(self, lines); +} +method_typedef( + PikaStdData_FILEIO_writelines, + "writelines", "lines" +); + +class_def(PikaStdData_FILEIO){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_FILEIO_close, 255564379), + method_def(PikaStdData_FILEIO_write, 279491920), + method_def(PikaStdData_FILEIO_readlines, 594708860), + method_def(PikaStdData_FILEIO_writelines, 836522731), + method_def(PikaStdData_FILEIO_readline, 2035354601), + method_def(PikaStdData_FILEIO_init, 2090370361), + method_def(PikaStdData_FILEIO_read, 2090683713), + method_def(PikaStdData_FILEIO_seek, 2090719789), + method_def(PikaStdData_FILEIO_tell, 2090755958), +}; +class_inhert(PikaStdData_FILEIO, TinyObj); + +PikaObj *New_PikaStdData_FILEIO(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_FILEIO); + return self; +} + +Arg *PikaStdData_FILEIO(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_FILEIO); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_List___add__Method(PikaObj *self, Args *args){ + PikaObj* others = args_getPtr(args, "others"); + PikaObj* res = PikaStdData_List___add__(self, others); + method_returnObj(args, res); +} +method_typedef( + PikaStdData_List___add__, + "__add__", "others" +); + +void PikaStdData_List___init__Method(PikaObj *self, Args *args){ + PikaStdData_List___init__(self); +} +method_typedef( + PikaStdData_List___init__, + "__init__", "" +); + +void PikaStdData_List___setitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* __val = args_getArg(args, "__val"); + PikaStdData_List___setitem__(self, __key, __val); +} +method_typedef( + PikaStdData_List___setitem__, + "__setitem__", "__key,__val" +); + +void PikaStdData_List___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_List___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_List___str__, + "__str__", "" +); + +void PikaStdData_List_appendMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + PikaStdData_List_append(self, arg); +} +method_typedef( + PikaStdData_List_append, + "append", "arg" +); + +void PikaStdData_List_insertMethod(PikaObj *self, Args *args){ + int i = args_getInt(args, "i"); + Arg* arg = args_getArg(args, "arg"); + PikaStdData_List_insert(self, i, arg); +} +method_typedef( + PikaStdData_List_insert, + "insert", "i,arg" +); + +void PikaStdData_List_popMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdData_List_pop(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_List_pop, + "pop", "" +); + +void PikaStdData_List_removeMethod(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + PikaStdData_List_remove(self, val); +} +method_typedef( + PikaStdData_List_remove, + "remove", "val" +); + +void PikaStdData_List_reverseMethod(PikaObj *self, Args *args){ + PikaStdData_List_reverse(self); +} +method_typedef( + PikaStdData_List_reverse, + "reverse", "" +); + +void PikaStdData_List_setMethod(PikaObj *self, Args *args){ + int i = args_getInt(args, "i"); + Arg* arg = args_getArg(args, "arg"); + PikaStdData_List_set(self, i, arg); +} +method_typedef( + PikaStdData_List_set, + "set", "i,arg" +); + +class_def(PikaStdData_List){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_List_insert, 81003162), + method_def(PikaStdData_List_pop, 193502740), + method_def(PikaStdData_List_set, 193505681), + method_def(PikaStdData_List_remove, 422343795), + method_def(PikaStdData_List___init__, 904762485), + method_def(PikaStdData_List_reverse, 1062753473), + method_def(PikaStdData_List___setitem__, 1364865276), + method_def(PikaStdData_List_append, 1917667549), + method_def(PikaStdData_List___add__, 2034897290), + method_def(PikaStdData_List___str__, 2056834106), +}; +class_inhert(PikaStdData_List, PikaStdData_Tuple); + +PikaObj *New_PikaStdData_List(Args *args){ + PikaObj *self = New_PikaStdData_Tuple(args); + obj_setClass(self, PikaStdData_List); + return self; +} + +Arg *PikaStdData_List(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_List); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_String___getitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* res = PikaStdData_String___getitem__(self, __key); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_String___getitem__, + "__getitem__", "__key" +); + +void PikaStdData_String___init__Method(PikaObj *self, Args *args){ + char* s = args_getStr(args, "s"); + PikaStdData_String___init__(self, s); +} +method_typedef( + PikaStdData_String___init__, + "__init__", "s" +); + +void PikaStdData_String___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_String___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_String___iter__, + "__iter__", "" +); + +void PikaStdData_String___len__Method(PikaObj *self, Args *args){ + int res = PikaStdData_String___len__(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String___len__, + "__len__", "" +); + +void PikaStdData_String___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_String___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_String___next__, + "__next__", "" +); + +void PikaStdData_String___setitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* __val = args_getArg(args, "__val"); + PikaStdData_String___setitem__(self, __key, __val); +} +method_typedef( + PikaStdData_String___setitem__, + "__setitem__", "__key,__val" +); + +void PikaStdData_String___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_String___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String___str__, + "__str__", "" +); + +void PikaStdData_String_encodeMethod(PikaObj *self, Args *args){ + PikaTuple* encoding = args_getTuple(args, "encoding"); + Arg* res = PikaStdData_String_encode(self, encoding); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_String_encode, + "encode", "*encoding" +); + +void PikaStdData_String_endswithMethod(PikaObj *self, Args *args){ + char* suffix = args_getStr(args, "suffix"); + int res = PikaStdData_String_endswith(self, suffix); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_endswith, + "endswith", "suffix" +); + +void PikaStdData_String_formatMethod(PikaObj *self, Args *args){ + PikaTuple* vars = args_getTuple(args, "vars"); + char* res = PikaStdData_String_format(self, vars); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String_format, + "format", "*vars" +); + +void PikaStdData_String_getMethod(PikaObj *self, Args *args){ + char* res = PikaStdData_String_get(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String_get, + "get", "" +); + +void PikaStdData_String_isalnumMethod(PikaObj *self, Args *args){ + int res = PikaStdData_String_isalnum(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_isalnum, + "isalnum", "" +); + +void PikaStdData_String_isalphaMethod(PikaObj *self, Args *args){ + int res = PikaStdData_String_isalpha(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_isalpha, + "isalpha", "" +); + +void PikaStdData_String_isdigitMethod(PikaObj *self, Args *args){ + int res = PikaStdData_String_isdigit(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_isdigit, + "isdigit", "" +); + +void PikaStdData_String_islowerMethod(PikaObj *self, Args *args){ + int res = PikaStdData_String_islower(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_islower, + "islower", "" +); + +void PikaStdData_String_isspaceMethod(PikaObj *self, Args *args){ + int res = PikaStdData_String_isspace(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_isspace, + "isspace", "" +); + +void PikaStdData_String_joinMethod(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + char* res = PikaStdData_String_join(self, val); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String_join, + "join", "val" +); + +void PikaStdData_String_replaceMethod(PikaObj *self, Args *args){ + char* old = args_getStr(args, "old"); + char* new = args_getStr(args, "new"); + char* res = PikaStdData_String_replace(self, old, new); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String_replace, + "replace", "old,new" +); + +void PikaStdData_String_setMethod(PikaObj *self, Args *args){ + char* s = args_getStr(args, "s"); + PikaStdData_String_set(self, s); +} +method_typedef( + PikaStdData_String_set, + "set", "s" +); + +void PikaStdData_String_splitMethod(PikaObj *self, Args *args){ + char* s = args_getStr(args, "s"); + PikaObj* res = PikaStdData_String_split(self, s); + method_returnObj(args, res); +} +method_typedef( + PikaStdData_String_split, + "split", "s" +); + +void PikaStdData_String_startswithMethod(PikaObj *self, Args *args){ + char* prefix = args_getStr(args, "prefix"); + int res = PikaStdData_String_startswith(self, prefix); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_String_startswith, + "startswith", "prefix" +); + +void PikaStdData_String_stripMethod(PikaObj *self, Args *args){ + PikaTuple* chrs = args_getTuple(args, "chrs"); + char* res = PikaStdData_String_strip(self, chrs); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_String_strip, + "strip", "*chrs" +); + +class_def(PikaStdData_String){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_String_get, 193492613), + method_def(PikaStdData_String_set, 193505681), + method_def(PikaStdData_String_split, 274679281), + method_def(PikaStdData_String_strip, 274829559), + method_def(PikaStdData_String_isalnum, 700198430), + method_def(PikaStdData_String_isalpha, 700200167), + method_def(PikaStdData_String_isdigit, 703640370), + method_def(PikaStdData_String_islower, 713360650), + method_def(PikaStdData_String_isspace, 721673997), + method_def(PikaStdData_String_startswith, 841709250), + method_def(PikaStdData_String___init__, 904762485), + method_def(PikaStdData_String___iter__, 911732085), + method_def(PikaStdData_String_endswith, 920277419), + method_def(PikaStdData_String_replace, 1055870465), + method_def(PikaStdData_String___next__, 1090305216), + method_def(PikaStdData_String___setitem__, 1364865276), + method_def(PikaStdData_String___getitem__, 1535436016), + method_def(PikaStdData_String___len__, 2047989248), + method_def(PikaStdData_String___str__, 2056834106), + method_def(PikaStdData_String_encode, 2071380659), + method_def(PikaStdData_String_join, 2090407381), + method_def(PikaStdData_String_format, 2112238766), +}; +class_inhert(PikaStdData_String, TinyObj); + +PikaObj *New_PikaStdData_String(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_String); + return self; +} + +Arg *PikaStdData_String(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_String); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_Tuple___contains__Method(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + int res = PikaStdData_Tuple___contains__(self, val); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_Tuple___contains__, + "__contains__", "val" +); + +void PikaStdData_Tuple___del__Method(PikaObj *self, Args *args){ + PikaStdData_Tuple___del__(self); +} +method_typedef( + PikaStdData_Tuple___del__, + "__del__", "" +); + +void PikaStdData_Tuple___getitem__Method(PikaObj *self, Args *args){ + Arg* __key = args_getArg(args, "__key"); + Arg* res = PikaStdData_Tuple___getitem__(self, __key); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Tuple___getitem__, + "__getitem__", "__key" +); + +void PikaStdData_Tuple___init__Method(PikaObj *self, Args *args){ + PikaStdData_Tuple___init__(self); +} +method_typedef( + PikaStdData_Tuple___init__, + "__init__", "" +); + +void PikaStdData_Tuple___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Tuple___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Tuple___iter__, + "__iter__", "" +); + +void PikaStdData_Tuple___len__Method(PikaObj *self, Args *args){ + int res = PikaStdData_Tuple___len__(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_Tuple___len__, + "__len__", "" +); + +void PikaStdData_Tuple___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_Tuple___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Tuple___next__, + "__next__", "" +); + +void PikaStdData_Tuple___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_Tuple___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_Tuple___str__, + "__str__", "" +); + +void PikaStdData_Tuple_getMethod(PikaObj *self, Args *args){ + int i = args_getInt(args, "i"); + Arg* res = PikaStdData_Tuple_get(self, i); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Tuple_get, + "get", "i" +); + +void PikaStdData_Tuple_lenMethod(PikaObj *self, Args *args){ + int res = PikaStdData_Tuple_len(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_Tuple_len, + "len", "" +); + +class_def(PikaStdData_Tuple){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_Tuple_get, 193492613), + method_def(PikaStdData_Tuple_len, 193498052), + method_def(PikaStdData_Tuple___init__, 904762485), + method_def(PikaStdData_Tuple___iter__, 911732085), + method_def(PikaStdData_Tuple___next__, 1090305216), + method_def(PikaStdData_Tuple___getitem__, 1535436016), + method_def(PikaStdData_Tuple___contains__, 1644201824), + method_def(PikaStdData_Tuple___del__, 2038499702), + method_def(PikaStdData_Tuple___len__, 2047989248), + method_def(PikaStdData_Tuple___str__, 2056834106), +}; +class_inhert(PikaStdData_Tuple, TinyObj); + +PikaObj *New_PikaStdData_Tuple(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_Tuple); + return self; +} + +Arg *PikaStdData_Tuple(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_Tuple); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_Utils_int_to_bytesMethod(PikaObj *self, Args *args){ + int val = args_getInt(args, "val"); + Arg* res = PikaStdData_Utils_int_to_bytes(self, val); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_Utils_int_to_bytes, + "int_to_bytes", "val" +); + +class_def(PikaStdData_Utils){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_Utils_int_to_bytes, 476200216), +}; +class_inhert(PikaStdData_Utils, TinyObj); + +PikaObj *New_PikaStdData_Utils(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_Utils); + return self; +} + +Arg *PikaStdData_Utils(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_Utils); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_dict_items___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_items___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_items___iter__, + "__iter__", "" +); + +void PikaStdData_dict_items___len__Method(PikaObj *self, Args *args){ + int res = PikaStdData_dict_items___len__(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_dict_items___len__, + "__len__", "" +); + +void PikaStdData_dict_items___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_items___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_items___next__, + "__next__", "" +); + +void PikaStdData_dict_items___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_dict_items___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_dict_items___str__, + "__str__", "" +); + +class_def(PikaStdData_dict_items){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_dict_items___iter__, 911732085), + method_def(PikaStdData_dict_items___next__, 1090305216), + method_def(PikaStdData_dict_items___len__, 2047989248), + method_def(PikaStdData_dict_items___str__, 2056834106), +}; +class_inhert(PikaStdData_dict_items, TinyObj); + +PikaObj *New_PikaStdData_dict_items(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_dict_items); + return self; +} + +Arg *PikaStdData_dict_items(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_dict_items); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDATA_DISABLE +void PikaStdData_dict_keys___iter__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_keys___iter__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_keys___iter__, + "__iter__", "" +); + +void PikaStdData_dict_keys___len__Method(PikaObj *self, Args *args){ + int res = PikaStdData_dict_keys___len__(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdData_dict_keys___len__, + "__len__", "" +); + +void PikaStdData_dict_keys___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdData_dict_keys___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdData_dict_keys___next__, + "__next__", "" +); + +void PikaStdData_dict_keys___str__Method(PikaObj *self, Args *args){ + char* res = PikaStdData_dict_keys___str__(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdData_dict_keys___str__, + "__str__", "" +); + +class_def(PikaStdData_dict_keys){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdData_dict_keys___iter__, 911732085), + method_def(PikaStdData_dict_keys___next__, 1090305216), + method_def(PikaStdData_dict_keys___len__, 2047989248), + method_def(PikaStdData_dict_keys___str__, 2056834106), +}; +class_inhert(PikaStdData_dict_keys, TinyObj); + +PikaObj *New_PikaStdData_dict_keys(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdData_dict_keys); + return self; +} + +Arg *PikaStdData_dict_keys(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdData_dict_keys); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_ADCMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_ADC(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_ADC, + "ADC", "" +); + +void PikaStdDevice_BaseDevMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_BaseDev(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_BaseDev, + "BaseDev", "" +); + +void PikaStdDevice_CANMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_CAN(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_CAN, + "CAN", "" +); + +void PikaStdDevice_DACMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_DAC(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_DAC, + "DAC", "" +); + +void PikaStdDevice_GPIOMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_GPIO(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_GPIO, + "GPIO", "" +); + +void PikaStdDevice_IICMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_IIC(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_IIC, + "IIC", "" +); + +void PikaStdDevice_PWMMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_PWM(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_PWM, + "PWM", "" +); + +void PikaStdDevice_SPIMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_SPI(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_SPI, + "SPI", "" +); + +void PikaStdDevice_TimeMethod(PikaObj *self, Args *args){ + PikaObj* res = PikaStdDevice_Time(self); + method_returnObj(args, res); +} +method_typedef( + PikaStdDevice_Time, + "Time", "" +); + +void PikaStdDevice_UARTMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdDevice_UART(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_UART, + "UART", "" +); + +class_def(PikaStdDevice){ + __BEFORE_MOETHOD_DEF + constructor_def(PikaStdDevice_ADC, 193450093), + constructor_def(PikaStdDevice_CAN, 193452183), + constructor_def(PikaStdDevice_DAC, 193453261), + constructor_def(PikaStdDevice_IIC, 193458970), + constructor_def(PikaStdDevice_PWM, 193467065), + constructor_def(PikaStdDevice_SPI, 193470097), + constructor_def(PikaStdDevice_BaseDev, 1189166879), + constructor_def(PikaStdDevice_GPIO, 2089114740), + constructor_def(PikaStdDevice_UART, 2089601825), + method_def(PikaStdDevice_Time, 2089610356), +}; +class_inhert(PikaStdDevice, TinyObj); + +PikaObj *New_PikaStdDevice(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdDevice); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_ADC___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_ADC___init__(self); +} +method_typedef( + PikaStdDevice_ADC___init__, + "__init__", "" +); + +void PikaStdDevice_ADC_closeMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_close(self); +} +method_typedef( + PikaStdDevice_ADC_close, + "close", "" +); + +void PikaStdDevice_ADC_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_disable(self); +} +method_typedef( + PikaStdDevice_ADC_disable, + "disable", "" +); + +void PikaStdDevice_ADC_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_enable(self); +} +method_typedef( + PikaStdDevice_ADC_enable, + "enable", "" +); + +void PikaStdDevice_ADC_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_platformDisable(self); +} +method_typedef( + PikaStdDevice_ADC_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_ADC_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_platformEnable(self); +} +method_typedef( + PikaStdDevice_ADC_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_ADC_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_ADC_platformRead(self); +} +method_typedef( + PikaStdDevice_ADC_platformRead, + "platformRead", "" +); + +void PikaStdDevice_ADC_readMethod(PikaObj *self, Args *args){ + pika_float res = PikaStdDevice_ADC_read(self); + method_returnFloat(args, res); +} +method_typedef( + PikaStdDevice_ADC_read, + "read", "" +); + +void PikaStdDevice_ADC_setPinMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_ADC_setPin(self, pin); +} +method_typedef( + PikaStdDevice_ADC_setPin, + "setPin", "pin" +); + +class_def(PikaStdDevice_ADC){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_ADC_close, 255564379), + method_def(PikaStdDevice_ADC_disable, 314893497), + method_def(PikaStdDevice_ADC_platformDisable, 326843198), + method_def(PikaStdDevice_ADC_setPin, 461696568), + method_def(PikaStdDevice_ADC_platformEnable, 835227025), + method_def(PikaStdDevice_ADC___init__, 904762485), + method_def(PikaStdDevice_ADC_platformRead, 1797695974), + method_def(PikaStdDevice_ADC_enable, 2071294892), + method_def(PikaStdDevice_ADC_read, 2090683713), +}; +class_inhert(PikaStdDevice_ADC, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_ADC(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_ADC); + return self; +} + +Arg *PikaStdDevice_ADC(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_ADC); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_BaseDev_addEventCallBackMethod(PikaObj *self, Args *args){ + Arg* eventCallback = args_getArg(args, "eventCallback"); + PikaStdDevice_BaseDev_addEventCallBack(self, eventCallback); +} +method_typedef( + PikaStdDevice_BaseDev_addEventCallBack, + "addEventCallBack", "eventCallback" +); + +void PikaStdDevice_BaseDev_platformGetEventIdMethod(PikaObj *self, Args *args){ + PikaStdDevice_BaseDev_platformGetEventId(self); +} +method_typedef( + PikaStdDevice_BaseDev_platformGetEventId, + "platformGetEventId", "" +); + +class_def(PikaStdDevice_BaseDev){ + __BEFORE_MOETHOD_DEF +#if PIKA_EVENT_ENABLE + method_def(PikaStdDevice_BaseDev_platformGetEventId, 794288473), +#endif +#if PIKA_EVENT_ENABLE + method_def(PikaStdDevice_BaseDev_addEventCallBack, 1710815869), +#endif +}; +class_inhert(PikaStdDevice_BaseDev, TinyObj); + +PikaObj *New_PikaStdDevice_BaseDev(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdDevice_BaseDev); + return self; +} + +Arg *PikaStdDevice_BaseDev(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_BaseDev); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_CAN___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_CAN___init__(self); +} +method_typedef( + PikaStdDevice_CAN___init__, + "__init__", "" +); + +void PikaStdDevice_CAN_addFilterMethod(PikaObj *self, Args *args){ + int id = args_getInt(args, "id"); + int ide = args_getInt(args, "ide"); + int rtr = args_getInt(args, "rtr"); + int mode = args_getInt(args, "mode"); + int mask = args_getInt(args, "mask"); + int hdr = args_getInt(args, "hdr"); + PikaStdDevice_CAN_addFilter(self, id, ide, rtr, mode, mask, hdr); +} +method_typedef( + PikaStdDevice_CAN_addFilter, + "addFilter", "id,ide,rtr,mode,mask,hdr" +); + +void PikaStdDevice_CAN_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_disable(self); +} +method_typedef( + PikaStdDevice_CAN_disable, + "disable", "" +); + +void PikaStdDevice_CAN_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_enable(self); +} +method_typedef( + PikaStdDevice_CAN_enable, + "enable", "" +); + +void PikaStdDevice_CAN_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformDisable(self); +} +method_typedef( + PikaStdDevice_CAN_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_CAN_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformEnable(self); +} +method_typedef( + PikaStdDevice_CAN_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_CAN_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformRead(self); +} +method_typedef( + PikaStdDevice_CAN_platformRead, + "platformRead", "" +); + +void PikaStdDevice_CAN_platformReadBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformReadBytes(self); +} +method_typedef( + PikaStdDevice_CAN_platformReadBytes, + "platformReadBytes", "" +); + +void PikaStdDevice_CAN_platformWriteMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformWrite(self); +} +method_typedef( + PikaStdDevice_CAN_platformWrite, + "platformWrite", "" +); + +void PikaStdDevice_CAN_platformWriteBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_CAN_platformWriteBytes(self); +} +method_typedef( + PikaStdDevice_CAN_platformWriteBytes, + "platformWriteBytes", "" +); + +void PikaStdDevice_CAN_readMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + char* res = PikaStdDevice_CAN_read(self, length); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_CAN_read, + "read", "length" +); + +void PikaStdDevice_CAN_readBytesMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + Arg* res = PikaStdDevice_CAN_readBytes(self, length); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_CAN_readBytes, + "readBytes", "length" +); + +void PikaStdDevice_CAN_setBaudRateMethod(PikaObj *self, Args *args){ + int baudRate = args_getInt(args, "baudRate"); + PikaStdDevice_CAN_setBaudRate(self, baudRate); +} +method_typedef( + PikaStdDevice_CAN_setBaudRate, + "setBaudRate", "baudRate" +); + +void PikaStdDevice_CAN_setIdMethod(PikaObj *self, Args *args){ + int id = args_getInt(args, "id"); + PikaStdDevice_CAN_setId(self, id); +} +method_typedef( + PikaStdDevice_CAN_setId, + "setId", "id" +); + +void PikaStdDevice_CAN_setModeMethod(PikaObj *self, Args *args){ + char* mode = args_getStr(args, "mode"); + PikaStdDevice_CAN_setMode(self, mode); +} +method_typedef( + PikaStdDevice_CAN_setMode, + "setMode", "mode" +); + +void PikaStdDevice_CAN_setNameMethod(PikaObj *self, Args *args){ + char* name = args_getStr(args, "name"); + PikaStdDevice_CAN_setName(self, name); +} +method_typedef( + PikaStdDevice_CAN_setName, + "setName", "name" +); + +void PikaStdDevice_CAN_writeMethod(PikaObj *self, Args *args){ + char* data = args_getStr(args, "data"); + PikaStdDevice_CAN_write(self, data); +} +method_typedef( + PikaStdDevice_CAN_write, + "write", "data" +); + +void PikaStdDevice_CAN_writeBytesMethod(PikaObj *self, Args *args){ + uint8_t* data = args_getBytes(args, "data"); + int length = args_getInt(args, "length"); + PikaStdDevice_CAN_writeBytes(self, data, length); +} +method_typedef( + PikaStdDevice_CAN_writeBytes, + "writeBytes", "data,length" +); + +class_def(PikaStdDevice_CAN){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_CAN_setMode, 203499702), + method_def(PikaStdDevice_CAN_setName, 203520690), + method_def(PikaStdDevice_CAN_setId, 274291614), + method_def(PikaStdDevice_CAN_write, 279491920), + method_def(PikaStdDevice_CAN_disable, 314893497), + method_def(PikaStdDevice_CAN_platformDisable, 326843198), + method_def(PikaStdDevice_CAN_addFilter, 464296980), + method_def(PikaStdDevice_CAN_readBytes, 545481704), + method_def(PikaStdDevice_CAN_platformReadBytes, 673804205), + method_def(PikaStdDevice_CAN_platformWriteBytes, 726970812), + method_def(PikaStdDevice_CAN_writeBytes, 787295575), + method_def(PikaStdDevice_CAN_platformEnable, 835227025), + method_def(PikaStdDevice_CAN___init__, 904762485), + method_def(PikaStdDevice_CAN_platformWrite, 1348314773), + method_def(PikaStdDevice_CAN_setBaudRate, 1620269241), + method_def(PikaStdDevice_CAN_platformRead, 1797695974), + method_def(PikaStdDevice_CAN_enable, 2071294892), + method_def(PikaStdDevice_CAN_read, 2090683713), +}; +class_inhert(PikaStdDevice_CAN, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_CAN(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_CAN); + return self; +} + +Arg *PikaStdDevice_CAN(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_CAN); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_DAC___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_DAC___init__(self); +} +method_typedef( + PikaStdDevice_DAC___init__, + "__init__", "" +); + +void PikaStdDevice_DAC_closeMethod(PikaObj *self, Args *args){ + PikaStdDevice_DAC_close(self); +} +method_typedef( + PikaStdDevice_DAC_close, + "close", "" +); + +void PikaStdDevice_DAC_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_DAC_disable(self); +} +method_typedef( + PikaStdDevice_DAC_disable, + "disable", "" +); + +void PikaStdDevice_DAC_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_DAC_enable(self); +} +method_typedef( + PikaStdDevice_DAC_enable, + "enable", "" +); + +void PikaStdDevice_DAC_setPinMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_DAC_setPin(self, pin); +} +method_typedef( + PikaStdDevice_DAC_setPin, + "setPin", "pin" +); + +void PikaStdDevice_DAC_writeMethod(PikaObj *self, Args *args){ + pika_float val = args_getFloat(args, "val"); + PikaStdDevice_DAC_write(self, val); +} +method_typedef( + PikaStdDevice_DAC_write, + "write", "val" +); + +class_def(PikaStdDevice_DAC){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_DAC_close, 255564379), + method_def(PikaStdDevice_DAC_write, 279491920), + method_def(PikaStdDevice_DAC_disable, 314893497), + method_def(PikaStdDevice_DAC_setPin, 461696568), + method_def(PikaStdDevice_DAC___init__, 904762485), + method_def(PikaStdDevice_DAC_enable, 2071294892), +}; +class_inhert(PikaStdDevice_DAC, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_DAC(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_DAC); + return self; +} + +Arg *PikaStdDevice_DAC(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_DAC); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_GPIO___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_GPIO___init__(self); +} +method_typedef( + PikaStdDevice_GPIO___init__, + "__init__", "" +); + +void PikaStdDevice_GPIO_closeMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_close(self); +} +method_typedef( + PikaStdDevice_GPIO_close, + "close", "" +); + +void PikaStdDevice_GPIO_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_disable(self); +} +method_typedef( + PikaStdDevice_GPIO_disable, + "disable", "" +); + +void PikaStdDevice_GPIO_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_enable(self); +} +method_typedef( + PikaStdDevice_GPIO_enable, + "enable", "" +); + +void PikaStdDevice_GPIO_getIdMethod(PikaObj *self, Args *args){ + int res = PikaStdDevice_GPIO_getId(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdDevice_GPIO_getId, + "getId", "" +); + +void PikaStdDevice_GPIO_getModeMethod(PikaObj *self, Args *args){ + char* res = PikaStdDevice_GPIO_getMode(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_GPIO_getMode, + "getMode", "" +); + +void PikaStdDevice_GPIO_getPinMethod(PikaObj *self, Args *args){ + char* res = PikaStdDevice_GPIO_getPin(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_GPIO_getPin, + "getPin", "" +); + +void PikaStdDevice_GPIO_highMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_high(self); +} +method_typedef( + PikaStdDevice_GPIO_high, + "high", "" +); + +void PikaStdDevice_GPIO_lowMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_low(self); +} +method_typedef( + PikaStdDevice_GPIO_low, + "low", "" +); + +void PikaStdDevice_GPIO_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformDisable(self); +} +method_typedef( + PikaStdDevice_GPIO_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_GPIO_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformEnable(self); +} +method_typedef( + PikaStdDevice_GPIO_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_GPIO_platformHighMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformHigh(self); +} +method_typedef( + PikaStdDevice_GPIO_platformHigh, + "platformHigh", "" +); + +void PikaStdDevice_GPIO_platformLowMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformLow(self); +} +method_typedef( + PikaStdDevice_GPIO_platformLow, + "platformLow", "" +); + +void PikaStdDevice_GPIO_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformRead(self); +} +method_typedef( + PikaStdDevice_GPIO_platformRead, + "platformRead", "" +); + +void PikaStdDevice_GPIO_platformSetModeMethod(PikaObj *self, Args *args){ + PikaStdDevice_GPIO_platformSetMode(self); +} +method_typedef( + PikaStdDevice_GPIO_platformSetMode, + "platformSetMode", "" +); + +void PikaStdDevice_GPIO_readMethod(PikaObj *self, Args *args){ + int res = PikaStdDevice_GPIO_read(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdDevice_GPIO_read, + "read", "" +); + +void PikaStdDevice_GPIO_setCallBackMethod(PikaObj *self, Args *args){ + Arg* eventCallBack = args_getArg(args, "eventCallBack"); + int filter = args_getInt(args, "filter"); + PikaStdDevice_GPIO_setCallBack(self, eventCallBack, filter); +} +method_typedef( + PikaStdDevice_GPIO_setCallBack, + "setCallBack", "eventCallBack,filter" +); + +void PikaStdDevice_GPIO_setIdMethod(PikaObj *self, Args *args){ + int id = args_getInt(args, "id"); + PikaStdDevice_GPIO_setId(self, id); +} +method_typedef( + PikaStdDevice_GPIO_setId, + "setId", "id" +); + +void PikaStdDevice_GPIO_setModeMethod(PikaObj *self, Args *args){ + char* mode = args_getStr(args, "mode"); + PikaStdDevice_GPIO_setMode(self, mode); +} +method_typedef( + PikaStdDevice_GPIO_setMode, + "setMode", "mode" +); + +void PikaStdDevice_GPIO_setPinMethod(PikaObj *self, Args *args){ + char* pinName = args_getStr(args, "pinName"); + PikaStdDevice_GPIO_setPin(self, pinName); +} +method_typedef( + PikaStdDevice_GPIO_setPin, + "setPin", "pinName" +); + +void PikaStdDevice_GPIO_setPullMethod(PikaObj *self, Args *args){ + char* pull = args_getStr(args, "pull"); + PikaStdDevice_GPIO_setPull(self, pull); +} +method_typedef( + PikaStdDevice_GPIO_setPull, + "setPull", "pull" +); + +class_def(PikaStdDevice_GPIO){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_GPIO_low, 193498391), + method_def(PikaStdDevice_GPIO_setMode, 203499702), + method_def(PikaStdDevice_GPIO_setPull, 203614318), + method_def(PikaStdDevice_GPIO_platformSetMode, 215449403), + method_def(PikaStdDevice_GPIO_close, 255564379), + method_def(PikaStdDevice_GPIO_getId, 260060562), + method_def(PikaStdDevice_GPIO_setId, 274291614), + method_def(PikaStdDevice_GPIO_disable, 314893497), + method_def(PikaStdDevice_GPIO_platformDisable, 326843198), + method_def(PikaStdDevice_GPIO_setPin, 461696568), + method_def(PikaStdDevice_GPIO_platformEnable, 835227025), + method_def(PikaStdDevice_GPIO___init__, 904762485), + method_def(PikaStdDevice_GPIO_setCallBack, 945732542), + method_def(PikaStdDevice_GPIO_platformLow, 1616275740), + method_def(PikaStdDevice_GPIO_platformHigh, 1797341162), + method_def(PikaStdDevice_GPIO_platformRead, 1797695974), + method_def(PikaStdDevice_GPIO_getMode, 1885753258), + method_def(PikaStdDevice_GPIO_enable, 2071294892), + method_def(PikaStdDevice_GPIO_high, 2090328901), + method_def(PikaStdDevice_GPIO_read, 2090683713), + method_def(PikaStdDevice_GPIO_getPin, 2139555500), +}; +class_inhert(PikaStdDevice_GPIO, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_GPIO(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_GPIO); + return self; +} + +Arg *PikaStdDevice_GPIO(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_GPIO); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_IIC___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_IIC___init__(self); +} +method_typedef( + PikaStdDevice_IIC___init__, + "__init__", "" +); + +void PikaStdDevice_IIC_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_disable(self); +} +method_typedef( + PikaStdDevice_IIC_disable, + "disable", "" +); + +void PikaStdDevice_IIC_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_enable(self); +} +method_typedef( + PikaStdDevice_IIC_enable, + "enable", "" +); + +void PikaStdDevice_IIC_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformDisable(self); +} +method_typedef( + PikaStdDevice_IIC_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_IIC_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformEnable(self); +} +method_typedef( + PikaStdDevice_IIC_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_IIC_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformRead(self); +} +method_typedef( + PikaStdDevice_IIC_platformRead, + "platformRead", "" +); + +void PikaStdDevice_IIC_platformReadBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformReadBytes(self); +} +method_typedef( + PikaStdDevice_IIC_platformReadBytes, + "platformReadBytes", "" +); + +void PikaStdDevice_IIC_platformWriteMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformWrite(self); +} +method_typedef( + PikaStdDevice_IIC_platformWrite, + "platformWrite", "" +); + +void PikaStdDevice_IIC_platformWriteBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_IIC_platformWriteBytes(self); +} +method_typedef( + PikaStdDevice_IIC_platformWriteBytes, + "platformWriteBytes", "" +); + +void PikaStdDevice_IIC_readMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int length = args_getInt(args, "length"); + char* res = PikaStdDevice_IIC_read(self, addr, length); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_IIC_read, + "read", "addr,length" +); + +void PikaStdDevice_IIC_readBytesMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int length = args_getInt(args, "length"); + Arg* res = PikaStdDevice_IIC_readBytes(self, addr, length); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_IIC_readBytes, + "readBytes", "addr,length" +); + +void PikaStdDevice_IIC_setDeviceAddrMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + PikaStdDevice_IIC_setDeviceAddr(self, addr); +} +method_typedef( + PikaStdDevice_IIC_setDeviceAddr, + "setDeviceAddr", "addr" +); + +void PikaStdDevice_IIC_setPinSCLMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_IIC_setPinSCL(self, pin); +} +method_typedef( + PikaStdDevice_IIC_setPinSCL, + "setPinSCL", "pin" +); + +void PikaStdDevice_IIC_setPinSDAMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_IIC_setPinSDA(self, pin); +} +method_typedef( + PikaStdDevice_IIC_setPinSDA, + "setPinSDA", "pin" +); + +void PikaStdDevice_IIC_writeMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + char* data = args_getStr(args, "data"); + PikaStdDevice_IIC_write(self, addr, data); +} +method_typedef( + PikaStdDevice_IIC_write, + "write", "addr,data" +); + +void PikaStdDevice_IIC_writeBytesMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + uint8_t* data = args_getBytes(args, "data"); + int length = args_getInt(args, "length"); + PikaStdDevice_IIC_writeBytes(self, addr, data, length); +} +method_typedef( + PikaStdDevice_IIC_writeBytes, + "writeBytes", "addr,data,length" +); + +class_def(PikaStdDevice_IIC){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_IIC_write, 279491920), + method_def(PikaStdDevice_IIC_disable, 314893497), + method_def(PikaStdDevice_IIC_platformDisable, 326843198), + method_def(PikaStdDevice_IIC_setPinSCL, 530992442), + method_def(PikaStdDevice_IIC_setPinSDA, 530992464), + method_def(PikaStdDevice_IIC_readBytes, 545481704), + method_def(PikaStdDevice_IIC_platformReadBytes, 673804205), + method_def(PikaStdDevice_IIC_platformWriteBytes, 726970812), + method_def(PikaStdDevice_IIC_writeBytes, 787295575), + method_def(PikaStdDevice_IIC_platformEnable, 835227025), + method_def(PikaStdDevice_IIC___init__, 904762485), + method_def(PikaStdDevice_IIC_setDeviceAddr, 1103920220), + method_def(PikaStdDevice_IIC_platformWrite, 1348314773), + method_def(PikaStdDevice_IIC_platformRead, 1797695974), + method_def(PikaStdDevice_IIC_enable, 2071294892), + method_def(PikaStdDevice_IIC_read, 2090683713), +}; +class_inhert(PikaStdDevice_IIC, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_IIC(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_IIC); + return self; +} + +Arg *PikaStdDevice_IIC(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_IIC); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_PWM___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_PWM___init__(self); +} +method_typedef( + PikaStdDevice_PWM___init__, + "__init__", "" +); + +void PikaStdDevice_PWM_closeMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_close(self); +} +method_typedef( + PikaStdDevice_PWM_close, + "close", "" +); + +void PikaStdDevice_PWM_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_disable(self); +} +method_typedef( + PikaStdDevice_PWM_disable, + "disable", "" +); + +void PikaStdDevice_PWM_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_enable(self); +} +method_typedef( + PikaStdDevice_PWM_enable, + "enable", "" +); + +void PikaStdDevice_PWM_getChannelMethod(PikaObj *self, Args *args){ + int res = PikaStdDevice_PWM_getChannel(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdDevice_PWM_getChannel, + "getChannel", "" +); + +void PikaStdDevice_PWM_getDutyMethod(PikaObj *self, Args *args){ + pika_float res = PikaStdDevice_PWM_getDuty(self); + method_returnFloat(args, res); +} +method_typedef( + PikaStdDevice_PWM_getDuty, + "getDuty", "" +); + +void PikaStdDevice_PWM_getFrequencyMethod(PikaObj *self, Args *args){ + int res = PikaStdDevice_PWM_getFrequency(self); + method_returnInt(args, res); +} +method_typedef( + PikaStdDevice_PWM_getFrequency, + "getFrequency", "" +); + +void PikaStdDevice_PWM_getNameMethod(PikaObj *self, Args *args){ + char* res = PikaStdDevice_PWM_getName(self); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_PWM_getName, + "getName", "" +); + +void PikaStdDevice_PWM_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_platformDisable(self); +} +method_typedef( + PikaStdDevice_PWM_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_PWM_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_platformEnable(self); +} +method_typedef( + PikaStdDevice_PWM_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_PWM_platformSetDutyMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_platformSetDuty(self); +} +method_typedef( + PikaStdDevice_PWM_platformSetDuty, + "platformSetDuty", "" +); + +void PikaStdDevice_PWM_platformSetFrequencyMethod(PikaObj *self, Args *args){ + PikaStdDevice_PWM_platformSetFrequency(self); +} +method_typedef( + PikaStdDevice_PWM_platformSetFrequency, + "platformSetFrequency", "" +); + +void PikaStdDevice_PWM_setChannelMethod(PikaObj *self, Args *args){ + int ch = args_getInt(args, "ch"); + PikaStdDevice_PWM_setChannel(self, ch); +} +method_typedef( + PikaStdDevice_PWM_setChannel, + "setChannel", "ch" +); + +void PikaStdDevice_PWM_setDutyMethod(PikaObj *self, Args *args){ + pika_float duty = args_getFloat(args, "duty"); + PikaStdDevice_PWM_setDuty(self, duty); +} +method_typedef( + PikaStdDevice_PWM_setDuty, + "setDuty", "duty" +); + +void PikaStdDevice_PWM_setFreqMethod(PikaObj *self, Args *args){ + int freq = args_getInt(args, "freq"); + PikaStdDevice_PWM_setFreq(self, freq); +} +method_typedef( + PikaStdDevice_PWM_setFreq, + "setFreq", "freq" +); + +void PikaStdDevice_PWM_setFrequencyMethod(PikaObj *self, Args *args){ + int freq = args_getInt(args, "freq"); + PikaStdDevice_PWM_setFrequency(self, freq); +} +method_typedef( + PikaStdDevice_PWM_setFrequency, + "setFrequency", "freq" +); + +void PikaStdDevice_PWM_setNameMethod(PikaObj *self, Args *args){ + char* name = args_getStr(args, "name"); + PikaStdDevice_PWM_setName(self, name); +} +method_typedef( + PikaStdDevice_PWM_setName, + "setName", "name" +); + +void PikaStdDevice_PWM_setPinMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_PWM_setPin(self, pin); +} +method_typedef( + PikaStdDevice_PWM_setPin, + "setPin", "pin" +); + +class_def(PikaStdDevice_PWM){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_PWM_setDuty, 203183351), + method_def(PikaStdDevice_PWM_setFreq, 203251455), + method_def(PikaStdDevice_PWM_setName, 203520690), + method_def(PikaStdDevice_PWM_platformSetDuty, 215133052), + method_def(PikaStdDevice_PWM_close, 255564379), + method_def(PikaStdDevice_PWM_disable, 314893497), + method_def(PikaStdDevice_PWM_platformDisable, 326843198), + method_def(PikaStdDevice_PWM_setPin, 461696568), + method_def(PikaStdDevice_PWM_setChannel, 680132682), + method_def(PikaStdDevice_PWM_platformEnable, 835227025), + method_def(PikaStdDevice_PWM___init__, 904762485), + method_def(PikaStdDevice_PWM_setFrequency, 1182403779), + method_def(PikaStdDevice_PWM_getDuty, 1885436907), + method_def(PikaStdDevice_PWM_getName, 1885774246), + method_def(PikaStdDevice_PWM_getChannel, 2013999806), + method_def(PikaStdDevice_PWM_platformSetFrequency, 2060729960), + method_def(PikaStdDevice_PWM_getFrequency, 2064755767), + method_def(PikaStdDevice_PWM_enable, 2071294892), +}; +class_inhert(PikaStdDevice_PWM, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_PWM(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_PWM); + return self; +} + +Arg *PikaStdDevice_PWM(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_PWM); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_SPI___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_SPI___init__(self); +} +method_typedef( + PikaStdDevice_SPI___init__, + "__init__", "" +); + +void PikaStdDevice_SPI_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_disable(self); +} +method_typedef( + PikaStdDevice_SPI_disable, + "disable", "" +); + +void PikaStdDevice_SPI_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_enable(self); +} +method_typedef( + PikaStdDevice_SPI_enable, + "enable", "" +); + +void PikaStdDevice_SPI_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformDisable(self); +} +method_typedef( + PikaStdDevice_SPI_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_SPI_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformEnable(self); +} +method_typedef( + PikaStdDevice_SPI_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_SPI_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformRead(self); +} +method_typedef( + PikaStdDevice_SPI_platformRead, + "platformRead", "" +); + +void PikaStdDevice_SPI_platformReadBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformReadBytes(self); +} +method_typedef( + PikaStdDevice_SPI_platformReadBytes, + "platformReadBytes", "" +); + +void PikaStdDevice_SPI_platformWriteMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformWrite(self); +} +method_typedef( + PikaStdDevice_SPI_platformWrite, + "platformWrite", "" +); + +void PikaStdDevice_SPI_platformWriteBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_SPI_platformWriteBytes(self); +} +method_typedef( + PikaStdDevice_SPI_platformWriteBytes, + "platformWriteBytes", "" +); + +void PikaStdDevice_SPI_readMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + char* res = PikaStdDevice_SPI_read(self, length); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_SPI_read, + "read", "length" +); + +void PikaStdDevice_SPI_readBytesMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + Arg* res = PikaStdDevice_SPI_readBytes(self, length); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_SPI_readBytes, + "readBytes", "length" +); + +void PikaStdDevice_SPI_setBaudRateMethod(PikaObj *self, Args *args){ + int baudRate = args_getInt(args, "baudRate"); + PikaStdDevice_SPI_setBaudRate(self, baudRate); +} +method_typedef( + PikaStdDevice_SPI_setBaudRate, + "setBaudRate", "baudRate" +); + +void PikaStdDevice_SPI_setIdMethod(PikaObj *self, Args *args){ + int id = args_getInt(args, "id"); + PikaStdDevice_SPI_setId(self, id); +} +method_typedef( + PikaStdDevice_SPI_setId, + "setId", "id" +); + +void PikaStdDevice_SPI_setNameMethod(PikaObj *self, Args *args){ + char* name = args_getStr(args, "name"); + PikaStdDevice_SPI_setName(self, name); +} +method_typedef( + PikaStdDevice_SPI_setName, + "setName", "name" +); + +void PikaStdDevice_SPI_setPhaseMethod(PikaObj *self, Args *args){ + int phase = args_getInt(args, "phase"); + PikaStdDevice_SPI_setPhase(self, phase); +} +method_typedef( + PikaStdDevice_SPI_setPhase, + "setPhase", "phase" +); + +void PikaStdDevice_SPI_setPinMISOMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_SPI_setPinMISO(self, pin); +} +method_typedef( + PikaStdDevice_SPI_setPinMISO, + "setPinMISO", "pin" +); + +void PikaStdDevice_SPI_setPinMOSIMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_SPI_setPinMOSI(self, pin); +} +method_typedef( + PikaStdDevice_SPI_setPinMOSI, + "setPinMOSI", "pin" +); + +void PikaStdDevice_SPI_setPinSCKMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_SPI_setPinSCK(self, pin); +} +method_typedef( + PikaStdDevice_SPI_setPinSCK, + "setPinSCK", "pin" +); + +void PikaStdDevice_SPI_setPolarityMethod(PikaObj *self, Args *args){ + int polarity = args_getInt(args, "polarity"); + PikaStdDevice_SPI_setPolarity(self, polarity); +} +method_typedef( + PikaStdDevice_SPI_setPolarity, + "setPolarity", "polarity" +); + +void PikaStdDevice_SPI_writeMethod(PikaObj *self, Args *args){ + char* data = args_getStr(args, "data"); + PikaStdDevice_SPI_write(self, data); +} +method_typedef( + PikaStdDevice_SPI_write, + "write", "data" +); + +void PikaStdDevice_SPI_writeBytesMethod(PikaObj *self, Args *args){ + uint8_t* data = args_getBytes(args, "data"); + int length = args_getInt(args, "length"); + PikaStdDevice_SPI_writeBytes(self, data, length); +} +method_typedef( + PikaStdDevice_SPI_writeBytes, + "writeBytes", "data,length" +); + +class_def(PikaStdDevice_SPI){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_SPI_setName, 203520690), + method_def(PikaStdDevice_SPI_setId, 274291614), + method_def(PikaStdDevice_SPI_setPhase, 276342722), + method_def(PikaStdDevice_SPI_write, 279491920), + method_def(PikaStdDevice_SPI_disable, 314893497), + method_def(PikaStdDevice_SPI_platformDisable, 326843198), + method_def(PikaStdDevice_SPI_setPinMISO, 342672624), + method_def(PikaStdDevice_SPI_setPinMOSI, 342679152), + method_def(PikaStdDevice_SPI_setPinSCK, 530992441), + method_def(PikaStdDevice_SPI_readBytes, 545481704), + method_def(PikaStdDevice_SPI_platformReadBytes, 673804205), + method_def(PikaStdDevice_SPI_platformWriteBytes, 726970812), + method_def(PikaStdDevice_SPI_writeBytes, 787295575), + method_def(PikaStdDevice_SPI_platformEnable, 835227025), + method_def(PikaStdDevice_SPI___init__, 904762485), + method_def(PikaStdDevice_SPI_platformWrite, 1348314773), + method_def(PikaStdDevice_SPI_setBaudRate, 1620269241), + method_def(PikaStdDevice_SPI_platformRead, 1797695974), + method_def(PikaStdDevice_SPI_setPolarity, 1824081573), + method_def(PikaStdDevice_SPI_enable, 2071294892), + method_def(PikaStdDevice_SPI_read, 2090683713), +}; +class_inhert(PikaStdDevice_SPI, PikaStdDevice_BaseDev); + +PikaObj *New_PikaStdDevice_SPI(Args *args){ + PikaObj *self = New_PikaStdDevice_BaseDev(args); + obj_setClass(self, PikaStdDevice_SPI); + return self; +} + +Arg *PikaStdDevice_SPI(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_SPI); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDDEVICE_DISABLE +void PikaStdDevice_UART___init__Method(PikaObj *self, Args *args){ + PikaStdDevice_UART___init__(self); +} +method_typedef( + PikaStdDevice_UART___init__, + "__init__", "" +); + +void PikaStdDevice_UART_closeMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_close(self); +} +method_typedef( + PikaStdDevice_UART_close, + "close", "" +); + +void PikaStdDevice_UART_disableMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_disable(self); +} +method_typedef( + PikaStdDevice_UART_disable, + "disable", "" +); + +void PikaStdDevice_UART_enableMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_enable(self); +} +method_typedef( + PikaStdDevice_UART_enable, + "enable", "" +); + +void PikaStdDevice_UART_platformDisableMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformDisable(self); +} +method_typedef( + PikaStdDevice_UART_platformDisable, + "platformDisable", "" +); + +void PikaStdDevice_UART_platformEnableMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformEnable(self); +} +method_typedef( + PikaStdDevice_UART_platformEnable, + "platformEnable", "" +); + +void PikaStdDevice_UART_platformReadMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformRead(self); +} +method_typedef( + PikaStdDevice_UART_platformRead, + "platformRead", "" +); + +void PikaStdDevice_UART_platformReadBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformReadBytes(self); +} +method_typedef( + PikaStdDevice_UART_platformReadBytes, + "platformReadBytes", "" +); + +void PikaStdDevice_UART_platformWriteMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformWrite(self); +} +method_typedef( + PikaStdDevice_UART_platformWrite, + "platformWrite", "" +); + +void PikaStdDevice_UART_platformWriteBytesMethod(PikaObj *self, Args *args){ + PikaStdDevice_UART_platformWriteBytes(self); +} +method_typedef( + PikaStdDevice_UART_platformWriteBytes, + "platformWriteBytes", "" +); + +void PikaStdDevice_UART_readMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + char* res = PikaStdDevice_UART_read(self, length); + method_returnStr(args, res); +} +method_typedef( + PikaStdDevice_UART_read, + "read", "length" +); + +void PikaStdDevice_UART_readBytesMethod(PikaObj *self, Args *args){ + int length = args_getInt(args, "length"); + Arg* res = PikaStdDevice_UART_readBytes(self, length); + method_returnArg(args, res); +} +method_typedef( + PikaStdDevice_UART_readBytes, + "readBytes", "length" +); + +void PikaStdDevice_UART_setBaudRateMethod(PikaObj *self, Args *args){ + int baudRate = args_getInt(args, "baudRate"); + PikaStdDevice_UART_setBaudRate(self, baudRate); +} +method_typedef( + PikaStdDevice_UART_setBaudRate, + "setBaudRate", "baudRate" +); + +void PikaStdDevice_UART_setCallBackMethod(PikaObj *self, Args *args){ + Arg* eventCallBack = args_getArg(args, "eventCallBack"); + int filter = args_getInt(args, "filter"); + PikaStdDevice_UART_setCallBack(self, eventCallBack, filter); +} +method_typedef( + PikaStdDevice_UART_setCallBack, + "setCallBack", "eventCallBack,filter" +); + +void PikaStdDevice_UART_setFlowControlMethod(PikaObj *self, Args *args){ + int flowControl = args_getInt(args, "flowControl"); + PikaStdDevice_UART_setFlowControl(self, flowControl); +} +method_typedef( + PikaStdDevice_UART_setFlowControl, + "setFlowControl", "flowControl" +); + +void PikaStdDevice_UART_setIdMethod(PikaObj *self, Args *args){ + int id = args_getInt(args, "id"); + PikaStdDevice_UART_setId(self, id); +} +method_typedef( + PikaStdDevice_UART_setId, + "setId", "id" +); + +void PikaStdDevice_UART_setPinCTSMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_UART_setPinCTS(self, pin); +} +method_typedef( + PikaStdDevice_UART_setPinCTS, + "setPinCTS", "pin" +); + +void PikaStdDevice_UART_setPinRTSMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_UART_setPinRTS(self, pin); +} +method_typedef( + PikaStdDevice_UART_setPinRTS, + "setPinRTS", "pin" +); + +void PikaStdDevice_UART_setPinRXMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_UART_setPinRX(self, pin); +} +method_typedef( + PikaStdDevice_UART_setPinRX, + "setPinRX", "pin" +); + +void PikaStdDevice_UART_setPinTXMethod(PikaObj *self, Args *args){ + char* pin = args_getStr(args, "pin"); + PikaStdDevice_UART_setPinTX(self, pin); +} +method_typedef( + PikaStdDevice_UART_setPinTX, + "setPinTX", "pin" +); + +void PikaStdDevice_UART_writeMethod(PikaObj *self, Args *args){ + char* data = args_getStr(args, "data"); + PikaStdDevice_UART_write(self, data); +} +method_typedef( + PikaStdDevice_UART_write, + "write", "data" +); + +void PikaStdDevice_UART_writeBytesMethod(PikaObj *self, Args *args){ + uint8_t* data = args_getBytes(args, "data"); + int length = args_getInt(args, "length"); + PikaStdDevice_UART_writeBytes(self, data, length); +} +method_typedef( + PikaStdDevice_UART_writeBytes, + "writeBytes", "data,length" +); + +class_def(PikaStdDevice_UART){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdDevice_UART_close, 255564379), + method_def(PikaStdDevice_UART_setId, 274291614), + method_def(PikaStdDevice_UART_setPinRX, 276391714), + method_def(PikaStdDevice_UART_setPinTX, 276391780), + method_def(PikaStdDevice_UART_write, 279491920), + method_def(PikaStdDevice_UART_disable, 314893497), + method_def(PikaStdDevice_UART_platformDisable, 326843198), + method_def(PikaStdDevice_UART_setPinCTS, 530975586), + method_def(PikaStdDevice_UART_setPinRTS, 530991921), + method_def(PikaStdDevice_UART_readBytes, 545481704), + method_def(PikaStdDevice_UART_platformReadBytes, 673804205), + method_def(PikaStdDevice_UART_platformWriteBytes, 726970812), + method_def(PikaStdDevice_UART_writeBytes, 787295575), + method_def(PikaStdDevice_UART_platformEnable, 835227025), + method_def(PikaStdDevice_UART___init__, 904762485), + method_def(PikaStdDevice_UART_setCallBack, 945732542), + method_def(PikaStdDevice_UART_platformWrite, 1348314773), + method_def(PikaStdDevice_UART_setFlowControl, 1507149322), + method_def(PikaStdDevice_UART_setBaudRate, 1620269241), + method_def(PikaStdDevice_UART_platformRead, 1797695974), + method_def(PikaStdDevice_UART_enable, 2071294892), + method_def(PikaStdDevice_UART_read, 2090683713), +}; +class_inhert(PikaStdDevice_UART, TinyObj); + +PikaObj *New_PikaStdDevice_UART(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdDevice_UART); + return self; +} + +Arg *PikaStdDevice_UART(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdDevice_UART); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDLIB_DISABLE +void PikaStdLib_MemCheckerMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_MemChecker(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_MemChecker, + "MemChecker", "" +); + +void PikaStdLib_RangeObjMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_RangeObj(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_RangeObj, + "RangeObj", "" +); + +void PikaStdLib_StringObjMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_StringObj(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_StringObj, + "StringObj", "" +); + +void PikaStdLib_SysObjMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_SysObj(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj, + "SysObj", "" +); + +class_def(PikaStdLib){ + __BEFORE_MOETHOD_DEF +#if 0 + constructor_def(PikaStdLib_StringObj, 145144695), +#endif + constructor_def(PikaStdLib_MemChecker, 426635353), + constructor_def(PikaStdLib_SysObj, 1380528799), +#if 0 + constructor_def(PikaStdLib_RangeObj, 1538428845), +#endif +}; +class_inhert(PikaStdLib, TinyObj); + +PikaObj *New_PikaStdLib(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdLib); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKASTDLIB_DISABLE +void PikaStdLib_MemChecker_getMaxMethod(PikaObj *self, Args *args){ + pika_float res = PikaStdLib_MemChecker_getMax(self); + method_returnFloat(args, res); +} +method_typedef( + PikaStdLib_MemChecker_getMax, + "getMax", "" +); + +void PikaStdLib_MemChecker_getNowMethod(PikaObj *self, Args *args){ + pika_float res = PikaStdLib_MemChecker_getNow(self); + method_returnFloat(args, res); +} +method_typedef( + PikaStdLib_MemChecker_getNow, + "getNow", "" +); + +void PikaStdLib_MemChecker_maxMethod(PikaObj *self, Args *args){ + PikaStdLib_MemChecker_max(self); +} +method_typedef( + PikaStdLib_MemChecker_max, + "max", "" +); + +void PikaStdLib_MemChecker_nowMethod(PikaObj *self, Args *args){ + PikaStdLib_MemChecker_now(self); +} +method_typedef( + PikaStdLib_MemChecker_now, + "now", "" +); + +void PikaStdLib_MemChecker_resetMaxMethod(PikaObj *self, Args *args){ + PikaStdLib_MemChecker_resetMax(self); +} +method_typedef( + PikaStdLib_MemChecker_resetMax, + "resetMax", "" +); + +class_def(PikaStdLib_MemChecker){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdLib_MemChecker_max, 193499019), + method_def(PikaStdLib_MemChecker_now, 193500569), +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_MemChecker_resetMax, 593750542), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_MemChecker_getMax, 2139551979), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_MemChecker_getNow, 2139553529), +#endif +}; +class_inhert(PikaStdLib_MemChecker, TinyObj); + +PikaObj *New_PikaStdLib_MemChecker(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdLib_MemChecker); + return self; +} + +Arg *PikaStdLib_MemChecker(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdLib_MemChecker); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDLIB_DISABLE +void PikaStdLib_RangeObj___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_RangeObj___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_RangeObj___next__, + "__next__", "" +); + +class_def(PikaStdLib_RangeObj){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdLib_RangeObj___next__, 1090305216), +}; +class_inhert(PikaStdLib_RangeObj, TinyObj); + +PikaObj *New_PikaStdLib_RangeObj(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdLib_RangeObj); + return self; +} + +Arg *PikaStdLib_RangeObj(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdLib_RangeObj); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDLIB_DISABLE +void PikaStdLib_StringObj___next__Method(PikaObj *self, Args *args){ + Arg* res = PikaStdLib_StringObj___next__(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_StringObj___next__, + "__next__", "" +); + +class_def(PikaStdLib_StringObj){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdLib_StringObj___next__, 1090305216), +}; +class_inhert(PikaStdLib_StringObj, TinyObj); + +PikaObj *New_PikaStdLib_StringObj(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdLib_StringObj); + return self; +} + +Arg *PikaStdLib_StringObj(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdLib_StringObj); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDLIB_DISABLE +void PikaStdLib_SysObj___getitem__Method(PikaObj *self, Args *args){ + Arg* obj = args_getArg(args, "obj"); + Arg* key = args_getArg(args, "key"); + Arg* res = PikaStdLib_SysObj___getitem__(self, obj, key); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj___getitem__, + "__getitem__", "obj,key" +); + +void PikaStdLib_SysObj___setitem__Method(PikaObj *self, Args *args){ + Arg* obj = args_getArg(args, "obj"); + Arg* key = args_getArg(args, "key"); + Arg* val = args_getArg(args, "val"); + Arg* res = PikaStdLib_SysObj___setitem__(self, obj, key, val); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj___setitem__, + "__setitem__", "obj,key,val" +); + +void PikaStdLib_SysObj_boolMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + PIKA_BOOL res = PikaStdLib_SysObj_bool(self, arg); + method_returnBool(args, res); +} +method_typedef( + PikaStdLib_SysObj_bool, + "bool", "arg" +); + +void PikaStdLib_SysObj_bytesMethod(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + Arg* res = PikaStdLib_SysObj_bytes(self, val); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_bytes, + "bytes", "val" +); + +void PikaStdLib_SysObj_cformatMethod(PikaObj *self, Args *args){ + char* fmt = args_getStr(args, "fmt"); + PikaTuple* var = args_getTuple(args, "var"); + char* res = PikaStdLib_SysObj_cformat(self, fmt, var); + method_returnStr(args, res); +} +method_typedef( + PikaStdLib_SysObj_cformat, + "cformat", "fmt,*var" +); + +void PikaStdLib_SysObj_chrMethod(PikaObj *self, Args *args){ + int val = args_getInt(args, "val"); + char* res = PikaStdLib_SysObj_chr(self, val); + method_returnStr(args, res); +} +method_typedef( + PikaStdLib_SysObj_chr, + "chr", "val" +); + +void PikaStdLib_SysObj_clearMethod(PikaObj *self, Args *args){ + PikaStdLib_SysObj_clear(self); +} +method_typedef( + PikaStdLib_SysObj_clear, + "clear", "" +); + +void PikaStdLib_SysObj_dictMethod(PikaObj *self, Args *args){ + PikaTuple* val = args_getTuple(args, "val"); + Arg* res = PikaStdLib_SysObj_dict(self, val); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_dict, + "dict", "*val" +); + +void PikaStdLib_SysObj_dirMethod(PikaObj *self, Args *args){ + Arg* obj = args_getArg(args, "obj"); + PikaObj* res = PikaStdLib_SysObj_dir(self, obj); + method_returnObj(args, res); +} +method_typedef( + PikaStdLib_SysObj_dir, + "dir", "obj" +); + +void PikaStdLib_SysObj_evalMethod(PikaObj *self, Args *args){ + char* code = args_getStr(args, "code"); + Arg* res = PikaStdLib_SysObj_eval(self, code); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_eval, + "eval", "code" +); + +void PikaStdLib_SysObj_execMethod(PikaObj *self, Args *args){ + char* code = args_getStr(args, "code"); + PikaStdLib_SysObj_exec(self, code); +} +method_typedef( + PikaStdLib_SysObj_exec, + "exec", "code" +); + +void PikaStdLib_SysObj_exitMethod(PikaObj *self, Args *args){ + PikaStdLib_SysObj_exit(self); +} +method_typedef( + PikaStdLib_SysObj_exit, + "exit", "" +); + +void PikaStdLib_SysObj_floatMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + pika_float res = PikaStdLib_SysObj_float(self, arg); + method_returnFloat(args, res); +} +method_typedef( + PikaStdLib_SysObj_float, + "float", "arg" +); + +void PikaStdLib_SysObj_gcdumpMethod(PikaObj *self, Args *args){ + PikaStdLib_SysObj_gcdump(self); +} +method_typedef( + PikaStdLib_SysObj_gcdump, + "gcdump", "" +); + +void PikaStdLib_SysObj_getattrMethod(PikaObj *self, Args *args){ + PikaObj* obj = args_getPtr(args, "obj"); + char* name = args_getStr(args, "name"); + Arg* res = PikaStdLib_SysObj_getattr(self, obj, name); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_getattr, + "getattr", "obj,name" +); + +void PikaStdLib_SysObj_hasattrMethod(PikaObj *self, Args *args){ + PikaObj* obj = args_getPtr(args, "obj"); + char* name = args_getStr(args, "name"); + int res = PikaStdLib_SysObj_hasattr(self, obj, name); + method_returnInt(args, res); +} +method_typedef( + PikaStdLib_SysObj_hasattr, + "hasattr", "obj,name" +); + +void PikaStdLib_SysObj_helpMethod(PikaObj *self, Args *args){ + char* name = args_getStr(args, "name"); + PikaStdLib_SysObj_help(self, name); +} +method_typedef( + PikaStdLib_SysObj_help, + "help", "name" +); + +void PikaStdLib_SysObj_hexMethod(PikaObj *self, Args *args){ + int val = args_getInt(args, "val"); + char* res = PikaStdLib_SysObj_hex(self, val); + method_returnStr(args, res); +} +method_typedef( + PikaStdLib_SysObj_hex, + "hex", "val" +); + +void PikaStdLib_SysObj_idMethod(PikaObj *self, Args *args){ + Arg* obj = args_getArg(args, "obj"); + int res = PikaStdLib_SysObj_id(self, obj); + method_returnInt(args, res); +} +method_typedef( + PikaStdLib_SysObj_id, + "id", "obj" +); + +void PikaStdLib_SysObj_inputMethod(PikaObj *self, Args *args){ + PikaTuple* info = args_getTuple(args, "info"); + char* res = PikaStdLib_SysObj_input(self, info); + method_returnStr(args, res); +} +method_typedef( + PikaStdLib_SysObj_input, + "input", "*info" +); + +void PikaStdLib_SysObj_intMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + int res = PikaStdLib_SysObj_int(self, arg); + method_returnInt(args, res); +} +method_typedef( + PikaStdLib_SysObj_int, + "int", "arg" +); + +void PikaStdLib_SysObj_iterMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + Arg* res = PikaStdLib_SysObj_iter(self, arg); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_iter, + "iter", "arg" +); + +void PikaStdLib_SysObj_lenMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + int res = PikaStdLib_SysObj_len(self, arg); + method_returnInt(args, res); +} +method_typedef( + PikaStdLib_SysObj_len, + "len", "arg" +); + +void PikaStdLib_SysObj_listMethod(PikaObj *self, Args *args){ + PikaTuple* val = args_getTuple(args, "val"); + Arg* res = PikaStdLib_SysObj_list(self, val); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_list, + "list", "*val" +); + +void PikaStdLib_SysObj_openMethod(PikaObj *self, Args *args){ + char* path = args_getStr(args, "path"); + char* mode = args_getStr(args, "mode"); + PikaObj* res = PikaStdLib_SysObj_open(self, path, mode); + method_returnObj(args, res); +} +method_typedef( + PikaStdLib_SysObj_open, + "open", "path,mode" +); + +void PikaStdLib_SysObj_ordMethod(PikaObj *self, Args *args){ + char* val = args_getStr(args, "val"); + int res = PikaStdLib_SysObj_ord(self, val); + method_returnInt(args, res); +} +method_typedef( + PikaStdLib_SysObj_ord, + "ord", "val" +); + +void PikaStdLib_SysObj_printMethod(PikaObj *self, Args *args){ + PikaTuple* val = args_getTuple(args, "val"); + PikaDict* ops = args_getDict(args, "ops"); + PikaStdLib_SysObj_print(self, val, ops); +} +method_typedef( + PikaStdLib_SysObj_print, + "print", "*val,**ops" +); + +void PikaStdLib_SysObj_rangeMethod(PikaObj *self, Args *args){ + PikaTuple* ax = args_getTuple(args, "ax"); + Arg* res = PikaStdLib_SysObj_range(self, ax); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_range, + "range", "*ax" +); + +void PikaStdLib_SysObj_rebootMethod(PikaObj *self, Args *args){ + PikaStdLib_SysObj_reboot(self); +} +method_typedef( + PikaStdLib_SysObj_reboot, + "reboot", "" +); + +void PikaStdLib_SysObj_setattrMethod(PikaObj *self, Args *args){ + PikaObj* obj = args_getPtr(args, "obj"); + char* name = args_getStr(args, "name"); + Arg* val = args_getArg(args, "val"); + PikaStdLib_SysObj_setattr(self, obj, name, val); +} +method_typedef( + PikaStdLib_SysObj_setattr, + "setattr", "obj,name,val" +); + +void PikaStdLib_SysObj_strMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + char* res = PikaStdLib_SysObj_str(self, arg); + method_returnStr(args, res); +} +method_typedef( + PikaStdLib_SysObj_str, + "str", "arg" +); + +void PikaStdLib_SysObj_tupleMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + Arg* res = PikaStdLib_SysObj_tuple(self, arg); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_tuple, + "tuple", "arg" +); + +void PikaStdLib_SysObj_typeMethod(PikaObj *self, Args *args){ + Arg* arg = args_getArg(args, "arg"); + Arg* res = PikaStdLib_SysObj_type(self, arg); + method_returnArg(args, res); +} +method_typedef( + PikaStdLib_SysObj_type, + "type", "arg" +); + +class_def(PikaStdLib_SysObj){ + __BEFORE_MOETHOD_DEF +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_id, 5863474), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_chr, 193488354), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_dir, 193489476), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_hex, 193493706), +#endif + method_def(PikaStdLib_SysObj_int, 193495088), + method_def(PikaStdLib_SysObj_len, 193498052), +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_ord, 193501738), +#endif + method_def(PikaStdLib_SysObj_str, 193506174), +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_setattr, 204224428), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_bytes, 254850636), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_clear, 255552908), +#endif + method_def(PikaStdLib_SysObj_float, 259121563), +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_input, 262752949), +#endif + method_def(PikaStdLib_SysObj_print, 271190290), + method_def(PikaStdLib_SysObj_range, 272956402), +#if PIKA_BUILTIN_STRUCT_ENABLE + method_def(PikaStdLib_SysObj_tuple, 276049327), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_reboot, 421948272), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_hasattr, 872734812), +#endif +#if PIKA_SYNTAX_FORMAT_ENABLE + method_def(PikaStdLib_SysObj_cformat, 1049381873), +#endif + method_def(PikaStdLib_SysObj___setitem__, 1364865276), + method_def(PikaStdLib_SysObj___getitem__, 1535436016), +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_getattr, 1886477984), +#endif + method_def(PikaStdLib_SysObj_bool, 2090120081), +#if PIKA_BUILTIN_STRUCT_ENABLE + method_def(PikaStdLib_SysObj_dict, 2090185033), +#endif +#if PIKA_EXEC_ENABLE + method_def(PikaStdLib_SysObj_eval, 2090235053), +#endif +#if PIKA_EXEC_ENABLE + method_def(PikaStdLib_SysObj_exec, 2090237354), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_exit, 2090237503), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_help, 2090324718), +#endif + method_def(PikaStdLib_SysObj_iter, 2090376761), +#if PIKA_BUILTIN_STRUCT_ENABLE + method_def(PikaStdLib_SysObj_list, 2090473057), +#endif +#if PIKA_FILEIO_ENABLE + method_def(PikaStdLib_SysObj_open, 2090588023), +#endif +#if !PIKA_NANO_ENABLE + method_def(PikaStdLib_SysObj_type, 2090777863), +#endif +#if PIKA_GC_MARK_SWEEP_ENABLE + method_def(PikaStdLib_SysObj_gcdump, 2136649093), +#endif +}; +class_inhert(PikaStdLib_SysObj, TinyObj); + +PikaObj *New_PikaStdLib_SysObj(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdLib_SysObj); + return self; +} + +Arg *PikaStdLib_SysObj(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdLib_SysObj); +} +#endif + +#ifndef PIKA_MODULE_PIKASTDTASK_DISABLE +void PikaStdTask_TaskMethod(PikaObj *self, Args *args){ + Arg* res = PikaStdTask_Task(self); + method_returnArg(args, res); +} +method_typedef( + PikaStdTask_Task, + "Task", "" +); + +class_def(PikaStdTask){ + __BEFORE_MOETHOD_DEF + constructor_def(PikaStdTask_Task, 2089601848), +}; +class_inhert(PikaStdTask, TinyObj); + +PikaObj *New_PikaStdTask(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, PikaStdTask); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKASTDTASK_DISABLE +void PikaStdTask_Task___init__Method(PikaObj *self, Args *args){ + PikaStdTask_Task___init__(self); +} +method_typedef( + PikaStdTask_Task___init__, + "__init__", "" +); + +void PikaStdTask_Task_call_alwaysMethod(PikaObj *self, Args *args){ + Arg* fun_todo = args_getArg(args, "fun_todo"); + PikaStdTask_Task_call_always(self, fun_todo); +} +method_typedef( + PikaStdTask_Task_call_always, + "call_always", "fun_todo" +); + +void PikaStdTask_Task_call_period_msMethod(PikaObj *self, Args *args){ + Arg* fun_todo = args_getArg(args, "fun_todo"); + int period_ms = args_getInt(args, "period_ms"); + PikaStdTask_Task_call_period_ms(self, fun_todo, period_ms); +} +method_typedef( + PikaStdTask_Task_call_period_ms, + "call_period_ms", "fun_todo,period_ms" +); + +void PikaStdTask_Task_call_whenMethod(PikaObj *self, Args *args){ + Arg* fun_todo = args_getArg(args, "fun_todo"); + Arg* fun_when = args_getArg(args, "fun_when"); + PikaStdTask_Task_call_when(self, fun_todo, fun_when); +} +method_typedef( + PikaStdTask_Task_call_when, + "call_when", "fun_todo,fun_when" +); + +void PikaStdTask_Task_platformGetTickMethod(PikaObj *self, Args *args){ + PikaStdTask_Task_platformGetTick(self); +} +method_typedef( + PikaStdTask_Task_platformGetTick, + "platformGetTick", "" +); + +void PikaStdTask_Task_run_foreverMethod(PikaObj *self, Args *args){ + PikaStdTask_Task_run_forever(self); +} +method_typedef( + PikaStdTask_Task_run_forever, + "run_forever", "" +); + +void PikaStdTask_Task_run_onceMethod(PikaObj *self, Args *args){ + PikaStdTask_Task_run_once(self); +} +method_typedef( + PikaStdTask_Task_run_once, + "run_once", "" +); + +void PikaStdTask_Task_run_until_msMethod(PikaObj *self, Args *args){ + int until_ms = args_getInt(args, "until_ms"); + PikaStdTask_Task_run_until_ms(self, until_ms); +} +method_typedef( + PikaStdTask_Task_run_until_ms, + "run_until_ms", "until_ms" +); + +class_def(PikaStdTask_Task){ + __BEFORE_MOETHOD_DEF + method_def(PikaStdTask_Task_run_forever, 408322738), + method_def(PikaStdTask_Task_run_until_ms, 854930212), + method_def(PikaStdTask_Task___init__, 904762485), + method_def(PikaStdTask_Task_call_always, 1368427953), + method_def(PikaStdTask_Task_call_period_ms, 1674236450), + method_def(PikaStdTask_Task_run_once, 1726949022), + method_def(PikaStdTask_Task_platformGetTick, 1897947957), + method_def(PikaStdTask_Task_call_when, 2141638002), +}; +class_inhert(PikaStdTask_Task, PikaStdLib_SysObj); + +PikaObj *New_PikaStdTask_Task(Args *args){ + PikaObj *self = New_PikaStdLib_SysObj(args); + obj_newObj(self, "calls", "PikaStdData_List", New_PikaStdData_List); + obj_setClass(self, PikaStdTask_Task); + return self; +} + +Arg *PikaStdTask_Task(PikaObj *self){ + return obj_newObjInPackage(New_PikaStdTask_Task); +} +#endif + +#ifndef PIKA_MODULE__MODBUS_DISABLE +void _modbus__ModBusMethod(PikaObj *self, Args *args){ + Arg* res = _modbus__ModBus(self); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus, + "_ModBus", "" +); + +class_def(_modbus){ + __BEFORE_MOETHOD_DEF + constructor_def(_modbus__ModBus, 1347026830), +}; +class_inhert(_modbus, TinyObj); + +PikaObj *New__modbus(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, _modbus); + return self; +} +#endif + +#ifndef PIKA_MODULE__MODBUS_DISABLE +void _modbus__ModBus___init__rtuMethod(PikaObj *self, Args *args){ + int sendBuffSize = args_getInt(args, "sendBuffSize"); + int readBuffSize = args_getInt(args, "readBuffSize"); + _modbus__ModBus___init__rtu(self, sendBuffSize, readBuffSize); +} +method_typedef( + _modbus__ModBus___init__rtu, + "__init__rtu", "sendBuffSize,readBuffSize" +); + +void _modbus__ModBus___init__tcpMethod(PikaObj *self, Args *args){ + int sendBuffSize = args_getInt(args, "sendBuffSize"); + int readBuffSize = args_getInt(args, "readBuffSize"); + _modbus__ModBus___init__tcp(self, sendBuffSize, readBuffSize); +} +method_typedef( + _modbus__ModBus___init__tcp, + "__init__tcp", "sendBuffSize,readBuffSize" +); + +void _modbus__ModBus_deserializeMaskWriteRegisterMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int res = _modbus__ModBus_deserializeMaskWriteRegister(self, msgLength); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_deserializeMaskWriteRegister, + "deserializeMaskWriteRegister", "msgLength" +); + +void _modbus__ModBus_deserializeReadBitsMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + Arg* res = _modbus__ModBus_deserializeReadBits(self, msgLength); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeReadBits, + "deserializeReadBits", "msgLength" +); + +void _modbus__ModBus_deserializeReadInputBitsMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + Arg* res = _modbus__ModBus_deserializeReadInputBits(self, msgLength); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeReadInputBits, + "deserializeReadInputBits", "msgLength" +); + +void _modbus__ModBus_deserializeReadInputRegistersMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + Arg* res = _modbus__ModBus_deserializeReadInputRegisters(self, msgLength); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeReadInputRegisters, + "deserializeReadInputRegisters", "msgLength" +); + +void _modbus__ModBus_deserializeReadRegistersMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + Arg* res = _modbus__ModBus_deserializeReadRegisters(self, msgLength); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeReadRegisters, + "deserializeReadRegisters", "msgLength" +); + +void _modbus__ModBus_deserializeReportSlaveIdMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int maxDest = args_getInt(args, "maxDest"); + Arg* res = _modbus__ModBus_deserializeReportSlaveId(self, msgLength, maxDest); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeReportSlaveId, + "deserializeReportSlaveId", "msgLength,maxDest" +); + +void _modbus__ModBus_deserializeWriteAndReadRegistersMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + Arg* res = _modbus__ModBus_deserializeWriteAndReadRegisters(self, msgLength); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_deserializeWriteAndReadRegisters, + "deserializeWriteAndReadRegisters", "msgLength" +); + +void _modbus__ModBus_deserializeWriteBitMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int res = _modbus__ModBus_deserializeWriteBit(self, msgLength); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_deserializeWriteBit, + "deserializeWriteBit", "msgLength" +); + +void _modbus__ModBus_deserializeWriteBitsMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int res = _modbus__ModBus_deserializeWriteBits(self, msgLength); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_deserializeWriteBits, + "deserializeWriteBits", "msgLength" +); + +void _modbus__ModBus_deserializeWriteRegisterMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int res = _modbus__ModBus_deserializeWriteRegister(self, msgLength); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_deserializeWriteRegister, + "deserializeWriteRegister", "msgLength" +); + +void _modbus__ModBus_deserializeWriteRegistersMethod(PikaObj *self, Args *args){ + int msgLength = args_getInt(args, "msgLength"); + int res = _modbus__ModBus_deserializeWriteRegisters(self, msgLength); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_deserializeWriteRegisters, + "deserializeWriteRegisters", "msgLength" +); + +void _modbus__ModBus_getReadBuffMethod(PikaObj *self, Args *args){ + Arg* res = _modbus__ModBus_getReadBuff(self); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_getReadBuff, + "getReadBuff", "" +); + +void _modbus__ModBus_getSendBuffMethod(PikaObj *self, Args *args){ + Arg* res = _modbus__ModBus_getSendBuff(self); + method_returnArg(args, res); +} +method_typedef( + _modbus__ModBus_getSendBuff, + "getSendBuff", "" +); + +void _modbus__ModBus_serializeMaskWriteRegisterMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int andMask = args_getInt(args, "andMask"); + int orMask = args_getInt(args, "orMask"); + int res = _modbus__ModBus_serializeMaskWriteRegister(self, addr, andMask, orMask); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeMaskWriteRegister, + "serializeMaskWriteRegister", "addr,andMask,orMask" +); + +void _modbus__ModBus_serializeReadBitsMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + int res = _modbus__ModBus_serializeReadBits(self, addr, nb); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeReadBits, + "serializeReadBits", "addr,nb" +); + +void _modbus__ModBus_serializeReadInputBitsMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + int res = _modbus__ModBus_serializeReadInputBits(self, addr, nb); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeReadInputBits, + "serializeReadInputBits", "addr,nb" +); + +void _modbus__ModBus_serializeReadInputRegistersMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + int res = _modbus__ModBus_serializeReadInputRegisters(self, addr, nb); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeReadInputRegisters, + "serializeReadInputRegisters", "addr,nb" +); + +void _modbus__ModBus_serializeReadRegistersMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + int res = _modbus__ModBus_serializeReadRegisters(self, addr, nb); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeReadRegisters, + "serializeReadRegisters", "addr,nb" +); + +void _modbus__ModBus_serializeReportSlaveIdMethod(PikaObj *self, Args *args){ + int res = _modbus__ModBus_serializeReportSlaveId(self); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeReportSlaveId, + "serializeReportSlaveId", "" +); + +void _modbus__ModBus_serializeWriteAndReadRegistersMethod(PikaObj *self, Args *args){ + int writeAddr = args_getInt(args, "writeAddr"); + int writeNb = args_getInt(args, "writeNb"); + uint8_t* src = args_getBytes(args, "src"); + int readAddr = args_getInt(args, "readAddr"); + int readNb = args_getInt(args, "readNb"); + int res = _modbus__ModBus_serializeWriteAndReadRegisters(self, writeAddr, writeNb, src, readAddr, readNb); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeWriteAndReadRegisters, + "serializeWriteAndReadRegisters", "writeAddr,writeNb,src,readAddr,readNb" +); + +void _modbus__ModBus_serializeWriteBitMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int status = args_getInt(args, "status"); + int res = _modbus__ModBus_serializeWriteBit(self, addr, status); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeWriteBit, + "serializeWriteBit", "addr,status" +); + +void _modbus__ModBus_serializeWriteBitsMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + uint8_t* src = args_getBytes(args, "src"); + int res = _modbus__ModBus_serializeWriteBits(self, addr, nb, src); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeWriteBits, + "serializeWriteBits", "addr,nb,src" +); + +void _modbus__ModBus_serializeWriteRegisterMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int value = args_getInt(args, "value"); + int res = _modbus__ModBus_serializeWriteRegister(self, addr, value); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeWriteRegister, + "serializeWriteRegister", "addr,value" +); + +void _modbus__ModBus_serializeWriteRegistersMethod(PikaObj *self, Args *args){ + int addr = args_getInt(args, "addr"); + int nb = args_getInt(args, "nb"); + uint8_t* src = args_getBytes(args, "src"); + int res = _modbus__ModBus_serializeWriteRegisters(self, addr, nb, src); + method_returnInt(args, res); +} +method_typedef( + _modbus__ModBus_serializeWriteRegisters, + "serializeWriteRegisters", "addr,nb,src" +); + +void _modbus__ModBus_setSlaveMethod(PikaObj *self, Args *args){ + int slave = args_getInt(args, "slave"); + _modbus__ModBus_setSlave(self, slave); +} +method_typedef( + _modbus__ModBus_setSlave, + "setSlave", "slave" +); + +class_def(_modbus__ModBus){ + __BEFORE_MOETHOD_DEF + method_def(_modbus__ModBus_serializeReadBits, 123506459), + method_def(_modbus__ModBus_serializeReadInputRegisters, 126389553), + method_def(_modbus__ModBus_setSlave, 280044332), + method_def(_modbus__ModBus_deserializeWriteBits, 349915763), + method_def(_modbus__ModBus_deserializeWriteRegisters, 517223801), + method_def(_modbus__ModBus_serializeWriteBit, 557327447), + method_def(_modbus__ModBus_serializeWriteRegisters, 807957776), + method_def(_modbus__ModBus_deserializeReportSlaveId, 867042330), + method_def(_modbus__ModBus_deserializeWriteRegister, 1056877638), + method_def(_modbus__ModBus_deserializeMaskWriteRegister, 1196122066), + method_def(_modbus__ModBus_deserializeReadBits, 1203664068), + method_def(_modbus__ModBus_serializeWriteBits, 1211936682), + method_def(_modbus__ModBus_serializeWriteAndReadRegisters, 1272743199), + method_def(_modbus__ModBus_deserializeReadRegisters, 1295219306), + method_def(_modbus__ModBus_deserializeReadInputBits, 1407501940), + method_def(_modbus__ModBus_serializeReportSlaveId, 1461529809), + method_def(_modbus__ModBus___init__rtu, 1547120816), + method_def(_modbus__ModBus___init__tcp, 1547122428), + method_def(_modbus__ModBus_deserializeWriteBit, 1637485056), + method_def(_modbus__ModBus_serializeWriteRegister, 1651365117), + method_def(_modbus__ModBus_getReadBuff, 1771141988), + method_def(_modbus__ModBus_serializeMaskWriteRegister, 1795034121), + method_def(_modbus__ModBus_deserializeReadInputRegisters, 1837128218), + method_def(_modbus__ModBus_serializeReadRegisters, 1889706785), + method_def(_modbus__ModBus_deserializeWriteAndReadRegisters, 1926272360), + method_def(_modbus__ModBus_getSendBuff, 1948672114), + method_def(_modbus__ModBus_serializeReadInputBits, 2001989419), +}; +class_inhert(_modbus__ModBus, TinyObj); + +PikaObj *New__modbus__ModBus(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, _modbus__ModBus); + return self; +} + +Arg *_modbus__ModBus(PikaObj *self){ + return obj_newObjInPackage(New__modbus__ModBus); +} +#endif + +#ifndef PIKA_MODULE__THREAD_DISABLE +void _thread_start_new_threadMethod(PikaObj *self, Args *args){ + Arg* function = args_getArg(args, "function"); + Arg* args_ = args_getArg(args, "args_"); + _thread_start_new_thread(self, function, args_); +} +method_typedef( + _thread_start_new_thread, + "start_new_thread", "function,args_" +); + +class_def(_thread){ + __BEFORE_MOETHOD_DEF + method_def(_thread_start_new_thread, 1487466483), +}; +class_inhert(_thread, TinyObj); + +PikaObj *New__thread(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, _thread); + return self; +} +#endif + +#ifndef PIKA_MODULE__TIME_DISABLE +void _time___init__Method(PikaObj *self, Args *args){ + _time___init__(self); +} +method_typedef( + _time___init__, + "__init__", "" +); + +void _time_asctimeMethod(PikaObj *self, Args *args){ + _time_asctime(self); +} +method_typedef( + _time_asctime, + "asctime", "" +); + +void _time_ctimeMethod(PikaObj *self, Args *args){ + pika_float unix_time = args_getFloat(args, "unix_time"); + _time_ctime(self, unix_time); +} +method_typedef( + _time_ctime, + "ctime", "unix_time" +); + +void _time_gmtimeMethod(PikaObj *self, Args *args){ + pika_float unix_time = args_getFloat(args, "unix_time"); + _time_gmtime(self, unix_time); +} +method_typedef( + _time_gmtime, + "gmtime", "unix_time" +); + +void _time_localtimeMethod(PikaObj *self, Args *args){ + pika_float unix_time = args_getFloat(args, "unix_time"); + _time_localtime(self, unix_time); +} +method_typedef( + _time_localtime, + "localtime", "unix_time" +); + +void _time_mktimeMethod(PikaObj *self, Args *args){ + int res = _time_mktime(self); + method_returnInt(args, res); +} +method_typedef( + _time_mktime, + "mktime", "" +); + +void _time_platformGetTickMethod(PikaObj *self, Args *args){ + _time_platformGetTick(self); +} +method_typedef( + _time_platformGetTick, + "platformGetTick", "" +); + +void _time_sleep_msMethod(PikaObj *self, Args *args){ + int ms = args_getInt(args, "ms"); + _time_sleep_ms(self, ms); +} +method_typedef( + _time_sleep_ms, + "sleep_ms", "ms" +); + +void _time_sleep_sMethod(PikaObj *self, Args *args){ + int s = args_getInt(args, "s"); + _time_sleep_s(self, s); +} +method_typedef( + _time_sleep_s, + "sleep_s", "s" +); + +void _time_timeMethod(PikaObj *self, Args *args){ + pika_float res = _time_time(self); + method_returnFloat(args, res); +} +method_typedef( + _time_time, + "time", "" +); + +void _time_time_nsMethod(PikaObj *self, Args *args){ + int res = _time_time_ns(self); + method_returnInt(args, res); +} +method_typedef( + _time_time_ns, + "time_ns", "" +); + +class_def(_time){ + __BEFORE_MOETHOD_DEF +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_gmtime, 1586568), +#endif + method_def(_time_sleep_ms, 164842493), +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_mktime, 234027084), +#endif +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_ctime, 255845143), +#endif + method_def(_time_sleep_s, 460522064), + method_def(_time___init__, 904762485), +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_localtime, 907356095), +#endif +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_asctime, 1108526539), +#endif +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_time_ns, 1644053204), +#endif +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_platformGetTick, 1897947957), +#endif +#if PIKA_STD_DEVICE_UNIX_TIME_ENABLE + method_def(_time_time, 2090760340), +#endif +}; +class_inhert(_time, TinyObj); + +PikaObj *New__time(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, _time); + return self; +} +#endif + +#ifndef PIKA_MODULE_BINASCII_DISABLE +void binascii_a2b_hexMethod(PikaObj *self, Args *args){ + char* val = args_getStr(args, "val"); + Arg* res = binascii_a2b_hex(self, val); + method_returnArg(args, res); +} +method_typedef( + binascii_a2b_hex, + "a2b_hex", "val" +); + +void binascii_b2a_hexMethod(PikaObj *self, Args *args){ + Arg* val = args_getArg(args, "val"); + Arg* res = binascii_b2a_hex(self, val); + method_returnArg(args, res); +} +method_typedef( + binascii_b2a_hex, + "b2a_hex", "val" +); + +class_def(binascii){ + __BEFORE_MOETHOD_DEF + method_def(binascii_a2b_hex, 710267710), + method_def(binascii_b2a_hex, 2000549758), +}; +class_inhert(binascii, TinyObj); + +PikaObj *New_binascii(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, binascii); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_ArrayMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Array(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Array, + "Array", "" +); + +void pika_cjson_ArrayReferenceMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_ArrayReference(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_ArrayReference, + "ArrayReference", "" +); + +void pika_cjson_BoolMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Bool(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Bool, + "Bool", "" +); + +void pika_cjson_False_Method(PikaObj *self, Args *args){ + Arg* res = pika_cjson_False_(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_False_, + "False_", "" +); + +void pika_cjson_NullMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Null(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Null, + "Null", "" +); + +void pika_cjson_NumberMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Number(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Number, + "Number", "" +); + +void pika_cjson_ObjectMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Object(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Object, + "Object", "" +); + +void pika_cjson_ObjectReferenceMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_ObjectReference(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_ObjectReference, + "ObjectReference", "" +); + +void pika_cjson_ParseMethod(PikaObj *self, Args *args){ + char* value = args_getStr(args, "value"); + PikaObj* res = pika_cjson_Parse(self, value); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_Parse, + "Parse", "value" +); + +void pika_cjson_RawMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_Raw(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_Raw, + "Raw", "" +); + +void pika_cjson_StringMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_String(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_String, + "String", "" +); + +void pika_cjson_StringReferenceMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_StringReference(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_StringReference, + "StringReference", "" +); + +void pika_cjson_True_Method(PikaObj *self, Args *args){ + Arg* res = pika_cjson_True_(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_True_, + "True_", "" +); + +void pika_cjson_cJSONMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_cJSON(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_cJSON, + "cJSON", "" +); + +class_def(pika_cjson){ + __BEFORE_MOETHOD_DEF + constructor_def(pika_cjson_Raw, 193469615), + constructor_def(pika_cjson_Array, 215461380), + method_def(pika_cjson_Parse, 232639840), + constructor_def(pika_cjson_True_, 237997252), + constructor_def(pika_cjson_cJSON, 254310818), + constructor_def(pika_cjson_False_, 843094319), + constructor_def(pika_cjson_Number, 1179913326), + constructor_def(pika_cjson_Object, 1196411612), + constructor_def(pika_cjson_String, 1374591964), + constructor_def(pika_cjson_ArrayReference, 1391479507), + constructor_def(pika_cjson_StringReference, 1644972971), + constructor_def(pika_cjson_ObjectReference, 1697798827), + constructor_def(pika_cjson_Bool, 2088970097), + constructor_def(pika_cjson_Null, 2089407776), +}; +class_inhert(pika_cjson, TinyObj); + +PikaObj *New_pika_cjson(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_cjson); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Array___init__Method(PikaObj *self, Args *args){ + pika_cjson_Array___init__(self); +} +method_typedef( + pika_cjson_Array___init__, + "__init__", "" +); + +class_def(pika_cjson_Array){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Array___init__, 904762485), +}; +class_inhert(pika_cjson_Array, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Array(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Array); + return self; +} + +Arg *pika_cjson_Array(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Array); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_ArrayReference___init__Method(PikaObj *self, Args *args){ + PikaObj* child = args_getPtr(args, "child"); + pika_cjson_ArrayReference___init__(self, child); +} +method_typedef( + pika_cjson_ArrayReference___init__, + "__init__", "child" +); + +class_def(pika_cjson_ArrayReference){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_ArrayReference___init__, 904762485), +}; +class_inhert(pika_cjson_ArrayReference, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_ArrayReference(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_ArrayReference); + return self; +} + +Arg *pika_cjson_ArrayReference(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_ArrayReference); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Bool___init__Method(PikaObj *self, Args *args){ + int bolean = args_getInt(args, "bolean"); + pika_cjson_Bool___init__(self, bolean); +} +method_typedef( + pika_cjson_Bool___init__, + "__init__", "bolean" +); + +class_def(pika_cjson_Bool){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Bool___init__, 904762485), +}; +class_inhert(pika_cjson_Bool, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Bool(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Bool); + return self; +} + +Arg *pika_cjson_Bool(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Bool); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_False____init__Method(PikaObj *self, Args *args){ + pika_cjson_False____init__(self); +} +method_typedef( + pika_cjson_False____init__, + "__init__", "" +); + +class_def(pika_cjson_False_){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_False____init__, 904762485), +}; +class_inhert(pika_cjson_False_, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_False_(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_False_); + return self; +} + +Arg *pika_cjson_False_(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_False_); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Null___init__Method(PikaObj *self, Args *args){ + pika_cjson_Null___init__(self); +} +method_typedef( + pika_cjson_Null___init__, + "__init__", "" +); + +class_def(pika_cjson_Null){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Null___init__, 904762485), +}; +class_inhert(pika_cjson_Null, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Null(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Null); + return self; +} + +Arg *pika_cjson_Null(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Null); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Number___init__Method(PikaObj *self, Args *args){ + pika_float num = args_getFloat(args, "num"); + pika_cjson_Number___init__(self, num); +} +method_typedef( + pika_cjson_Number___init__, + "__init__", "num" +); + +class_def(pika_cjson_Number){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Number___init__, 904762485), +}; +class_inhert(pika_cjson_Number, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Number(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Number); + return self; +} + +Arg *pika_cjson_Number(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Number); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Object___init__Method(PikaObj *self, Args *args){ + pika_cjson_Object___init__(self); +} +method_typedef( + pika_cjson_Object___init__, + "__init__", "" +); + +class_def(pika_cjson_Object){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Object___init__, 904762485), +}; +class_inhert(pika_cjson_Object, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Object(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Object); + return self; +} + +Arg *pika_cjson_Object(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Object); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_ObjectReference___init__Method(PikaObj *self, Args *args){ + PikaObj* child = args_getPtr(args, "child"); + pika_cjson_ObjectReference___init__(self, child); +} +method_typedef( + pika_cjson_ObjectReference___init__, + "__init__", "child" +); + +class_def(pika_cjson_ObjectReference){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_ObjectReference___init__, 904762485), +}; +class_inhert(pika_cjson_ObjectReference, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_ObjectReference(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_ObjectReference); + return self; +} + +Arg *pika_cjson_ObjectReference(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_ObjectReference); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_Raw___init__Method(PikaObj *self, Args *args){ + char* raw = args_getStr(args, "raw"); + pika_cjson_Raw___init__(self, raw); +} +method_typedef( + pika_cjson_Raw___init__, + "__init__", "raw" +); + +class_def(pika_cjson_Raw){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_Raw___init__, 904762485), +}; +class_inhert(pika_cjson_Raw, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_Raw(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_Raw); + return self; +} + +Arg *pika_cjson_Raw(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_Raw); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_String___init__Method(PikaObj *self, Args *args){ + char* string = args_getStr(args, "string"); + pika_cjson_String___init__(self, string); +} +method_typedef( + pika_cjson_String___init__, + "__init__", "string" +); + +class_def(pika_cjson_String){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_String___init__, 904762485), +}; +class_inhert(pika_cjson_String, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_String(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_String); + return self; +} + +Arg *pika_cjson_String(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_String); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_StringReference___init__Method(PikaObj *self, Args *args){ + char* string = args_getStr(args, "string"); + pika_cjson_StringReference___init__(self, string); +} +method_typedef( + pika_cjson_StringReference___init__, + "__init__", "string" +); + +class_def(pika_cjson_StringReference){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_StringReference___init__, 904762485), +}; +class_inhert(pika_cjson_StringReference, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_StringReference(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_StringReference); + return self; +} + +Arg *pika_cjson_StringReference(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_StringReference); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_True____init__Method(PikaObj *self, Args *args){ + pika_cjson_True____init__(self); +} +method_typedef( + pika_cjson_True____init__, + "__init__", "" +); + +class_def(pika_cjson_True_){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_True____init__, 904762485), +}; +class_inhert(pika_cjson_True_, pika_cjson_cJSON); + +PikaObj *New_pika_cjson_True_(Args *args){ + PikaObj *self = New_pika_cjson_cJSON(args); + obj_setClass(self, pika_cjson_True_); + return self; +} + +Arg *pika_cjson_True_(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_True_); +} +#endif + +#ifndef PIKA_MODULE_PIKA_CJSON_DISABLE +void pika_cjson_cJSON___del__Method(PikaObj *self, Args *args){ + pika_cjson_cJSON___del__(self); +} +method_typedef( + pika_cjson_cJSON___del__, + "__del__", "" +); + +void pika_cjson_cJSON___init__Method(PikaObj *self, Args *args){ + pika_cjson_cJSON___init__(self); +} +method_typedef( + pika_cjson_cJSON___init__, + "__init__", "" +); + +void pika_cjson_cJSON_addItemToArrayMethod(PikaObj *self, Args *args){ + PikaObj* item = args_getPtr(args, "item"); + pika_cjson_cJSON_addItemToArray(self, item); +} +method_typedef( + pika_cjson_cJSON_addItemToArray, + "addItemToArray", "item" +); + +void pika_cjson_cJSON_addItemToObjectMethod(PikaObj *self, Args *args){ + char* string = args_getStr(args, "string"); + PikaObj* item = args_getPtr(args, "item"); + pika_cjson_cJSON_addItemToObject(self, string, item); +} +method_typedef( + pika_cjson_cJSON_addItemToObject, + "addItemToObject", "string,item" +); + +void pika_cjson_cJSON_getArrayItemMethod(PikaObj *self, Args *args){ + int index = args_getInt(args, "index"); + PikaObj* res = pika_cjson_cJSON_getArrayItem(self, index); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_cJSON_getArrayItem, + "getArrayItem", "index" +); + +void pika_cjson_cJSON_getArraySizeMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_getArraySize(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_getArraySize, + "getArraySize", "" +); + +void pika_cjson_cJSON_getChildMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_cjson_cJSON_getChild(self); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_cJSON_getChild, + "getChild", "" +); + +void pika_cjson_cJSON_getNextMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_cjson_cJSON_getNext(self); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_cJSON_getNext, + "getNext", "" +); + +void pika_cjson_cJSON_getObjectItemMethod(PikaObj *self, Args *args){ + char* string = args_getStr(args, "string"); + PikaObj* res = pika_cjson_cJSON_getObjectItem(self, string); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_cJSON_getObjectItem, + "getObjectItem", "string" +); + +void pika_cjson_cJSON_getPrevMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_cjson_cJSON_getPrev(self); + method_returnObj(args, res); +} +method_typedef( + pika_cjson_cJSON_getPrev, + "getPrev", "" +); + +void pika_cjson_cJSON_getStringMethod(PikaObj *self, Args *args){ + char* res = pika_cjson_cJSON_getString(self); + method_returnStr(args, res); +} +method_typedef( + pika_cjson_cJSON_getString, + "getString", "" +); + +void pika_cjson_cJSON_getTypeMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_getType(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_getType, + "getType", "" +); + +void pika_cjson_cJSON_getValueMethod(PikaObj *self, Args *args){ + Arg* res = pika_cjson_cJSON_getValue(self); + method_returnArg(args, res); +} +method_typedef( + pika_cjson_cJSON_getValue, + "getValue", "" +); + +void pika_cjson_cJSON_getValueDoubleMethod(PikaObj *self, Args *args){ + pika_float res = pika_cjson_cJSON_getValueDouble(self); + method_returnFloat(args, res); +} +method_typedef( + pika_cjson_cJSON_getValueDouble, + "getValueDouble", "" +); + +void pika_cjson_cJSON_getValueIntMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_getValueInt(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_getValueInt, + "getValueInt", "" +); + +void pika_cjson_cJSON_getValueStringMethod(PikaObj *self, Args *args){ + char* res = pika_cjson_cJSON_getValueString(self); + method_returnStr(args, res); +} +method_typedef( + pika_cjson_cJSON_getValueString, + "getValueString", "" +); + +void pika_cjson_cJSON_isArrayMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isArray(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isArray, + "isArray", "" +); + +void pika_cjson_cJSON_isBoolMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isBool(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isBool, + "isBool", "" +); + +void pika_cjson_cJSON_isFalseMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isFalse(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isFalse, + "isFalse", "" +); + +void pika_cjson_cJSON_isInvalidMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isInvalid(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isInvalid, + "isInvalid", "" +); + +void pika_cjson_cJSON_isNullMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isNull(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isNull, + "isNull", "" +); + +void pika_cjson_cJSON_isNumberMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isNumber(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isNumber, + "isNumber", "" +); + +void pika_cjson_cJSON_isObjectMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isObject(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isObject, + "isObject", "" +); + +void pika_cjson_cJSON_isRawMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isRaw(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isRaw, + "isRaw", "" +); + +void pika_cjson_cJSON_isStringMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isString(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isString, + "isString", "" +); + +void pika_cjson_cJSON_isTrueMethod(PikaObj *self, Args *args){ + int res = pika_cjson_cJSON_isTrue(self); + method_returnInt(args, res); +} +method_typedef( + pika_cjson_cJSON_isTrue, + "isTrue", "" +); + +void pika_cjson_cJSON_printMethod(PikaObj *self, Args *args){ + char* res = pika_cjson_cJSON_print(self); + method_returnStr(args, res); +} +method_typedef( + pika_cjson_cJSON_print, + "print", "" +); + +class_def(pika_cjson_cJSON){ + __BEFORE_MOETHOD_DEF + method_def(pika_cjson_cJSON_getValueInt, 27177613), + method_def(pika_cjson_cJSON_isBool, 85182637), + method_def(pika_cjson_cJSON_isNull, 85620316), + method_def(pika_cjson_cJSON_isTrue, 85832961), + method_def(pika_cjson_cJSON_isRaw, 262899307), + method_def(pika_cjson_cJSON_print, 271190290), + method_def(pika_cjson_cJSON_getObjectItem, 309075179), + method_def(pika_cjson_cJSON_isArray, 662468288), + method_def(pika_cjson_cJSON_isFalse, 667781004), + method_def(pika_cjson_cJSON_getString, 832183644), + method_def(pika_cjson_cJSON_isNumber, 898755754), + method_def(pika_cjson_cJSON___init__, 904762485), + method_def(pika_cjson_cJSON_isObject, 915254040), + method_def(pika_cjson_cJSON_isString, 1093434392), + method_def(pika_cjson_cJSON_addItemToArray, 1395058367), + method_def(pika_cjson_cJSON_isInvalid, 1463460584), + method_def(pika_cjson_cJSON_addItemToObject, 1468406519), + method_def(pika_cjson_cJSON_getValueDouble, 1529957469), + method_def(pika_cjson_cJSON_getNext, 1885778980), + method_def(pika_cjson_cJSON_getPrev, 1885864386), + method_def(pika_cjson_cJSON_getType, 1886016103), + method_def(pika_cjson_cJSON_getArrayItem, 2017403923), + method_def(pika_cjson_cJSON_getArraySize, 2017751999), + method_def(pika_cjson_cJSON___del__, 2038499702), + method_def(pika_cjson_cJSON_getChild, 2088210377), + method_def(pika_cjson_cJSON_getValue, 2110494882), + method_def(pika_cjson_cJSON_getValueString, 2122817849), +}; +class_inhert(pika_cjson_cJSON, TinyObj); + +PikaObj *New_pika_cjson_cJSON(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_cjson_cJSON); + return self; +} + +Arg *pika_cjson_cJSON(PikaObj *self){ + return obj_newObjInPackage(New_pika_cjson_cJSON); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LIBC_DISABLE +class_def(pika_libc){ + __BEFORE_MOETHOD_DEF +}; +class_inhert(pika_libc, TinyObj); + +PikaObj *New_pika_libc(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_libc); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_ALIGNMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_ALIGN(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_ALIGN, + "ALIGN", "" +); + +void pika_lvgl_ANIMMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_ANIM(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_ANIM, + "ANIM", "" +); + +void pika_lvgl_EVENTMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_EVENT(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_EVENT, + "EVENT", "" +); + +void pika_lvgl_FLEX_ALIGNMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_FLEX_ALIGN(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_FLEX_ALIGN, + "FLEX_ALIGN", "" +); + +void pika_lvgl_FLEX_FLOWMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_FLEX_FLOW(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_FLEX_FLOW, + "FLEX_FLOW", "" +); + +void pika_lvgl_LAYOUT_FLEXMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_LAYOUT_FLEX(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_LAYOUT_FLEX, + "LAYOUT_FLEX", "" +); + +void pika_lvgl_OPAMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_OPA(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_OPA, + "OPA", "" +); + +void pika_lvgl_PALETTEMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_PALETTE(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_PALETTE, + "PALETTE", "" +); + +void pika_lvgl_SIZEMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_SIZE(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_SIZE, + "SIZE", "" +); + +void pika_lvgl_STATEMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_STATE(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_STATE, + "STATE", "" +); + +void pika_lvgl_TEXT_DECORMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_TEXT_DECOR(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_TEXT_DECOR, + "TEXT_DECOR", "" +); + +void pika_lvgl___del__Method(PikaObj *self, Args *args){ + pika_lvgl___del__(self); +} +method_typedef( + pika_lvgl___del__, + "__del__", "" +); + +void pika_lvgl___init__Method(PikaObj *self, Args *args){ + pika_lvgl___init__(self); +} +method_typedef( + pika_lvgl___init__, + "__init__", "" +); + +void pika_lvgl_arcMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_arc(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_arc, + "arc", "" +); + +void pika_lvgl_barMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_bar(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_bar, + "bar", "" +); + +void pika_lvgl_btnMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_btn(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_btn, + "btn", "" +); + +void pika_lvgl_checkboxMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_checkbox(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_checkbox, + "checkbox", "" +); + +void pika_lvgl_dropdownMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_dropdown(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_dropdown, + "dropdown", "" +); + +void pika_lvgl_flag_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_flag_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_flag_t, + "flag_t", "" +); + +void pika_lvgl_imgMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_img(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_img, + "img", "" +); + +void pika_lvgl_img_dsc_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_img_dsc_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_img_dsc_t, + "img_dsc_t", "" +); + +void pika_lvgl_indev_get_actMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_lvgl_indev_get_act(self); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_indev_get_act, + "indev_get_act", "" +); + +void pika_lvgl_indev_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_indev_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_indev_t, + "indev_t", "" +); + +void pika_lvgl_labelMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_label(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_label, + "label", "" +); + +void pika_lvgl_lv_color_hexMethod(PikaObj *self, Args *args){ + int64_t hex = args_getInt(args, "hex"); + PikaObj* res = pika_lvgl_lv_color_hex(self, hex); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_lv_color_hex, + "lv_color_hex", "hex" +); + +void pika_lvgl_lv_color_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_lv_color_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_lv_color_t, + "lv_color_t", "" +); + +void pika_lvgl_lv_eventMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_lv_event(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_lv_event, + "lv_event", "" +); + +void pika_lvgl_lv_objMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_lv_obj(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_lv_obj, + "lv_obj", "" +); + +void pika_lvgl_lv_timer_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_lv_timer_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_lv_timer_t, + "lv_timer_t", "" +); + +void pika_lvgl_objMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_obj(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_obj, + "obj", "" +); + +void pika_lvgl_palette_lightenMethod(PikaObj *self, Args *args){ + int p = args_getInt(args, "p"); + int lvl = args_getInt(args, "lvl"); + PikaObj* res = pika_lvgl_palette_lighten(self, p, lvl); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_palette_lighten, + "palette_lighten", "p,lvl" +); + +void pika_lvgl_palette_mainMethod(PikaObj *self, Args *args){ + int p = args_getInt(args, "p"); + PikaObj* res = pika_lvgl_palette_main(self, p); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_palette_main, + "palette_main", "p" +); + +void pika_lvgl_pctMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + int res = pika_lvgl_pct(self, x); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_pct, + "pct", "x" +); + +void pika_lvgl_point_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_point_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_point_t, + "point_t", "" +); + +void pika_lvgl_rollerMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_roller(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_roller, + "roller", "" +); + +void pika_lvgl_scr_actMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_lvgl_scr_act(self); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_scr_act, + "scr_act", "" +); + +void pika_lvgl_sliderMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_slider(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_slider, + "slider", "" +); + +void pika_lvgl_style_tMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_style_t(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_style_t, + "style_t", "" +); + +void pika_lvgl_switchMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_switch(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_switch, + "switch", "" +); + +void pika_lvgl_tableMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_table(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_table, + "table", "" +); + +void pika_lvgl_textareaMethod(PikaObj *self, Args *args){ + Arg* res = pika_lvgl_textarea(self); + method_returnArg(args, res); +} +method_typedef( + pika_lvgl_textarea, + "textarea", "" +); + +void pika_lvgl_timer_create_basicMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_lvgl_timer_create_basic(self); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_timer_create_basic, + "timer_create_basic", "" +); + +class_def(pika_lvgl){ + __BEFORE_MOETHOD_DEF + constructor_def(pika_lvgl_FLEX_FLOW, 54903627), + method_def(pika_lvgl_scr_act, 123488676), + constructor_def(pika_lvgl_lv_event, 131156360), + constructor_def(pika_lvgl_textarea, 144113955), + constructor_def(pika_lvgl_OPA, 193465733), + constructor_def(pika_lvgl_arc, 193486491), + constructor_def(pika_lvgl_bar, 193487034), + constructor_def(pika_lvgl_btn, 193487657), + constructor_def(pika_lvgl_img, 193495042), + constructor_def(pika_lvgl_obj, 193501216), + method_def(pika_lvgl_pct, 193502348), + constructor_def(pika_lvgl_lv_obj, 207188321), + constructor_def(pika_lvgl_ALIGN, 214050224), + constructor_def(pika_lvgl_EVENT, 219149159), + constructor_def(pika_lvgl_STATE, 235676006), + constructor_def(pika_lvgl_label, 265827749), + constructor_def(pika_lvgl_table, 275315341), + constructor_def(pika_lvgl_checkbox, 296102156), + constructor_def(pika_lvgl_lv_color_t, 394293688), + constructor_def(pika_lvgl_dropdown, 401183730), + constructor_def(pika_lvgl_roller, 434163253), + constructor_def(pika_lvgl_slider, 469624360), + constructor_def(pika_lvgl_switch, 482686839), + constructor_def(pika_lvgl_indev_t, 507835662), + method_def(pika_lvgl_palette_lighten, 573278590), + constructor_def(pika_lvgl_lv_timer_t, 640426874), + constructor_def(pika_lvgl_img_dsc_t, 784949518), + constructor_def(pika_lvgl_PALETTE, 790132596), + constructor_def(pika_lvgl_style_t, 797563209), + method_def(pika_lvgl___init__, 904762485), + constructor_def(pika_lvgl_point_t, 1003563106), + constructor_def(pika_lvgl_TEXT_DECOR, 1241293750), + constructor_def(pika_lvgl_LAYOUT_FLEX, 1259909937), + method_def(pika_lvgl_timer_create_basic, 1321143834), + method_def(pika_lvgl_palette_main, 1452255384), + constructor_def(pika_lvgl_FLEX_ALIGN, 1805883102), + method_def(pika_lvgl_lv_color_hex, 2036570665), + method_def(pika_lvgl___del__, 2038499702), + constructor_def(pika_lvgl_ANIM, 2088896938), + constructor_def(pika_lvgl_SIZE, 2089538912), + constructor_def(pika_lvgl_flag_t, 2108063474), + method_def(pika_lvgl_indev_get_act, 2120537489), +}; +class_inhert(pika_lvgl, TinyObj); + +PikaObj *New_pika_lvgl(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl); + return self; +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_ALIGN___init__Method(PikaObj *self, Args *args){ + pika_lvgl_ALIGN___init__(self); +} +method_typedef( + pika_lvgl_ALIGN___init__, + "__init__", "" +); + +class_def(pika_lvgl_ALIGN){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_ALIGN___init__, 904762485), +}; +class_inhert(pika_lvgl_ALIGN, TinyObj); + +PikaObj *New_pika_lvgl_ALIGN(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_ALIGN); + return self; +} + +Arg *pika_lvgl_ALIGN(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_ALIGN); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_ANIM___init__Method(PikaObj *self, Args *args){ + pika_lvgl_ANIM___init__(self); +} +method_typedef( + pika_lvgl_ANIM___init__, + "__init__", "" +); + +class_def(pika_lvgl_ANIM){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_ANIM___init__, 904762485), +}; +class_inhert(pika_lvgl_ANIM, TinyObj); + +PikaObj *New_pika_lvgl_ANIM(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_ANIM); + return self; +} + +Arg *pika_lvgl_ANIM(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_ANIM); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_EVENT___init__Method(PikaObj *self, Args *args){ + pika_lvgl_EVENT___init__(self); +} +method_typedef( + pika_lvgl_EVENT___init__, + "__init__", "" +); + +class_def(pika_lvgl_EVENT){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_EVENT___init__, 904762485), +}; +class_inhert(pika_lvgl_EVENT, TinyObj); + +PikaObj *New_pika_lvgl_EVENT(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_EVENT); + return self; +} + +Arg *pika_lvgl_EVENT(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_EVENT); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_FLEX_ALIGN___init__Method(PikaObj *self, Args *args){ + pika_lvgl_FLEX_ALIGN___init__(self); +} +method_typedef( + pika_lvgl_FLEX_ALIGN___init__, + "__init__", "" +); + +class_def(pika_lvgl_FLEX_ALIGN){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_FLEX_ALIGN___init__, 904762485), +}; +class_inhert(pika_lvgl_FLEX_ALIGN, TinyObj); + +PikaObj *New_pika_lvgl_FLEX_ALIGN(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_FLEX_ALIGN); + return self; +} + +Arg *pika_lvgl_FLEX_ALIGN(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_FLEX_ALIGN); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_FLEX_FLOW___init__Method(PikaObj *self, Args *args){ + pika_lvgl_FLEX_FLOW___init__(self); +} +method_typedef( + pika_lvgl_FLEX_FLOW___init__, + "__init__", "" +); + +class_def(pika_lvgl_FLEX_FLOW){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_FLEX_FLOW___init__, 904762485), +}; +class_inhert(pika_lvgl_FLEX_FLOW, TinyObj); + +PikaObj *New_pika_lvgl_FLEX_FLOW(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_FLEX_FLOW); + return self; +} + +Arg *pika_lvgl_FLEX_FLOW(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_FLEX_FLOW); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_LAYOUT_FLEX___init__Method(PikaObj *self, Args *args){ + pika_lvgl_LAYOUT_FLEX___init__(self); +} +method_typedef( + pika_lvgl_LAYOUT_FLEX___init__, + "__init__", "" +); + +class_def(pika_lvgl_LAYOUT_FLEX){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_LAYOUT_FLEX___init__, 904762485), +}; +class_inhert(pika_lvgl_LAYOUT_FLEX, TinyObj); + +PikaObj *New_pika_lvgl_LAYOUT_FLEX(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_LAYOUT_FLEX); + return self; +} + +Arg *pika_lvgl_LAYOUT_FLEX(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_LAYOUT_FLEX); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_OPA___init__Method(PikaObj *self, Args *args){ + pika_lvgl_OPA___init__(self); +} +method_typedef( + pika_lvgl_OPA___init__, + "__init__", "" +); + +class_def(pika_lvgl_OPA){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_OPA___init__, 904762485), +}; +class_inhert(pika_lvgl_OPA, TinyObj); + +PikaObj *New_pika_lvgl_OPA(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_OPA); + return self; +} + +Arg *pika_lvgl_OPA(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_OPA); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_PALETTE___init__Method(PikaObj *self, Args *args){ + pika_lvgl_PALETTE___init__(self); +} +method_typedef( + pika_lvgl_PALETTE___init__, + "__init__", "" +); + +class_def(pika_lvgl_PALETTE){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_PALETTE___init__, 904762485), +}; +class_inhert(pika_lvgl_PALETTE, TinyObj); + +PikaObj *New_pika_lvgl_PALETTE(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_PALETTE); + return self; +} + +Arg *pika_lvgl_PALETTE(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_PALETTE); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_SIZE___init__Method(PikaObj *self, Args *args){ + pika_lvgl_SIZE___init__(self); +} +method_typedef( + pika_lvgl_SIZE___init__, + "__init__", "" +); + +class_def(pika_lvgl_SIZE){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_SIZE___init__, 904762485), +}; +class_inhert(pika_lvgl_SIZE, TinyObj); + +PikaObj *New_pika_lvgl_SIZE(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_SIZE); + return self; +} + +Arg *pika_lvgl_SIZE(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_SIZE); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_STATE___init__Method(PikaObj *self, Args *args){ + pika_lvgl_STATE___init__(self); +} +method_typedef( + pika_lvgl_STATE___init__, + "__init__", "" +); + +class_def(pika_lvgl_STATE){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_STATE___init__, 904762485), +}; +class_inhert(pika_lvgl_STATE, TinyObj); + +PikaObj *New_pika_lvgl_STATE(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_STATE); + return self; +} + +Arg *pika_lvgl_STATE(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_STATE); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_TEXT_DECOR___init__Method(PikaObj *self, Args *args){ + pika_lvgl_TEXT_DECOR___init__(self); +} +method_typedef( + pika_lvgl_TEXT_DECOR___init__, + "__init__", "" +); + +class_def(pika_lvgl_TEXT_DECOR){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_TEXT_DECOR___init__, 904762485), +}; +class_inhert(pika_lvgl_TEXT_DECOR, TinyObj); + +PikaObj *New_pika_lvgl_TEXT_DECOR(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_TEXT_DECOR); + return self; +} + +Arg *pika_lvgl_TEXT_DECOR(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_TEXT_DECOR); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_arc___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_arc___init__(self, parent); +} +method_typedef( + pika_lvgl_arc___init__, + "__init__", "parent" +); + +void pika_lvgl_arc_get_angle_endMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_angle_end(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_angle_end, + "get_angle_end", "" +); + +void pika_lvgl_arc_get_angle_startMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_angle_start(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_angle_start, + "get_angle_start", "" +); + +void pika_lvgl_arc_get_bg_angle_endMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_bg_angle_end(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_bg_angle_end, + "get_bg_angle_end", "" +); + +void pika_lvgl_arc_get_bg_angle_startMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_bg_angle_start(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_bg_angle_start, + "get_bg_angle_start", "" +); + +void pika_lvgl_arc_get_max_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_max_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_max_value, + "get_max_value", "" +); + +void pika_lvgl_arc_get_min_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_min_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_min_value, + "get_min_value", "" +); + +void pika_lvgl_arc_get_modeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_mode(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_mode, + "get_mode", "" +); + +void pika_lvgl_arc_get_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_arc_get_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_arc_get_value, + "get_value", "" +); + +void pika_lvgl_arc_set_anglesMethod(PikaObj *self, Args *args){ + int start = args_getInt(args, "start"); + int end = args_getInt(args, "end"); + pika_lvgl_arc_set_angles(self, start, end); +} +method_typedef( + pika_lvgl_arc_set_angles, + "set_angles", "start,end" +); + +void pika_lvgl_arc_set_bg_anglesMethod(PikaObj *self, Args *args){ + int start = args_getInt(args, "start"); + int end = args_getInt(args, "end"); + pika_lvgl_arc_set_bg_angles(self, start, end); +} +method_typedef( + pika_lvgl_arc_set_bg_angles, + "set_bg_angles", "start,end" +); + +void pika_lvgl_arc_set_bg_end_angleMethod(PikaObj *self, Args *args){ + int angle = args_getInt(args, "angle"); + pika_lvgl_arc_set_bg_end_angle(self, angle); +} +method_typedef( + pika_lvgl_arc_set_bg_end_angle, + "set_bg_end_angle", "angle" +); + +void pika_lvgl_arc_set_bg_start_angleMethod(PikaObj *self, Args *args){ + int start = args_getInt(args, "start"); + pika_lvgl_arc_set_bg_start_angle(self, start); +} +method_typedef( + pika_lvgl_arc_set_bg_start_angle, + "set_bg_start_angle", "start" +); + +void pika_lvgl_arc_set_change_rateMethod(PikaObj *self, Args *args){ + int rate = args_getInt(args, "rate"); + pika_lvgl_arc_set_change_rate(self, rate); +} +method_typedef( + pika_lvgl_arc_set_change_rate, + "set_change_rate", "rate" +); + +void pika_lvgl_arc_set_end_angleMethod(PikaObj *self, Args *args){ + int angle = args_getInt(args, "angle"); + pika_lvgl_arc_set_end_angle(self, angle); +} +method_typedef( + pika_lvgl_arc_set_end_angle, + "set_end_angle", "angle" +); + +void pika_lvgl_arc_set_modeMethod(PikaObj *self, Args *args){ + int mode = args_getInt(args, "mode"); + pika_lvgl_arc_set_mode(self, mode); +} +method_typedef( + pika_lvgl_arc_set_mode, + "set_mode", "mode" +); + +void pika_lvgl_arc_set_rangeMethod(PikaObj *self, Args *args){ + int min = args_getInt(args, "min"); + int max = args_getInt(args, "max"); + pika_lvgl_arc_set_range(self, min, max); +} +method_typedef( + pika_lvgl_arc_set_range, + "set_range", "min,max" +); + +void pika_lvgl_arc_set_rotationMethod(PikaObj *self, Args *args){ + int rotation = args_getInt(args, "rotation"); + pika_lvgl_arc_set_rotation(self, rotation); +} +method_typedef( + pika_lvgl_arc_set_rotation, + "set_rotation", "rotation" +); + +void pika_lvgl_arc_set_start_angleMethod(PikaObj *self, Args *args){ + int start = args_getInt(args, "start"); + pika_lvgl_arc_set_start_angle(self, start); +} +method_typedef( + pika_lvgl_arc_set_start_angle, + "set_start_angle", "start" +); + +void pika_lvgl_arc_set_valueMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_arc_set_value(self, value); +} +method_typedef( + pika_lvgl_arc_set_value, + "set_value", "value" +); + +class_def(pika_lvgl_arc){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_arc_set_angles, 75229290), + method_def(pika_lvgl_arc_set_bg_start_angle, 105253004), + method_def(pika_lvgl_arc_set_mode, 294325973), + method_def(pika_lvgl_arc_get_min_value, 332722052), + method_def(pika_lvgl_arc_get_bg_angle_start, 343363008), + method_def(pika_lvgl_arc_set_rotation, 772090656), + method_def(pika_lvgl_arc_get_max_value, 864856070), + method_def(pika_lvgl_arc___init__, 904762485), + method_def(pika_lvgl_arc_get_angle_end, 1032805057), + method_def(pika_lvgl_arc_set_change_rate, 1036405217), + method_def(pika_lvgl_arc_set_end_angle, 1114876493), + method_def(pika_lvgl_arc_set_range, 1128260061), + method_def(pika_lvgl_arc_set_value, 1133002029), + method_def(pika_lvgl_arc_set_bg_end_angle, 1198536661), + method_def(pika_lvgl_arc_get_value, 1303572769), + method_def(pika_lvgl_arc_set_start_angle, 1341126916), + method_def(pika_lvgl_arc_get_angle_start, 1607578296), + method_def(pika_lvgl_arc_get_bg_angle_end, 1753387977), + method_def(pika_lvgl_arc_set_bg_angles, 1944068850), + method_def(pika_lvgl_arc_get_mode, 2121602121), +}; +class_inhert(pika_lvgl_arc, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_arc(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_arc); + return self; +} + +Arg *pika_lvgl_arc(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_arc); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_bar___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_bar___init__(self, parent); +} +method_typedef( + pika_lvgl_bar___init__, + "__init__", "parent" +); + +void pika_lvgl_bar_get_max_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_bar_get_max_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_bar_get_max_value, + "get_max_value", "" +); + +void pika_lvgl_bar_get_min_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_bar_get_min_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_bar_get_min_value, + "get_min_value", "" +); + +void pika_lvgl_bar_get_modeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_bar_get_mode(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_bar_get_mode, + "get_mode", "" +); + +void pika_lvgl_bar_get_start_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_bar_get_start_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_bar_get_start_value, + "get_start_value", "" +); + +void pika_lvgl_bar_get_valueMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_bar_get_value(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_bar_get_value, + "get_value", "" +); + +void pika_lvgl_bar_set_modeMethod(PikaObj *self, Args *args){ + int mode = args_getInt(args, "mode"); + pika_lvgl_bar_set_mode(self, mode); +} +method_typedef( + pika_lvgl_bar_set_mode, + "set_mode", "mode" +); + +void pika_lvgl_bar_set_rangeMethod(PikaObj *self, Args *args){ + int min = args_getInt(args, "min"); + int max = args_getInt(args, "max"); + pika_lvgl_bar_set_range(self, min, max); +} +method_typedef( + pika_lvgl_bar_set_range, + "set_range", "min,max" +); + +void pika_lvgl_bar_set_start_valueMethod(PikaObj *self, Args *args){ + int start_value = args_getInt(args, "start_value"); + int anim = args_getInt(args, "anim"); + pika_lvgl_bar_set_start_value(self, start_value, anim); +} +method_typedef( + pika_lvgl_bar_set_start_value, + "set_start_value", "start_value,anim" +); + +void pika_lvgl_bar_set_valueMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + int anim = args_getInt(args, "anim"); + pika_lvgl_bar_set_value(self, value, anim); +} +method_typedef( + pika_lvgl_bar_set_value, + "set_value", "value,anim" +); + +class_def(pika_lvgl_bar){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_bar_set_mode, 294325973), + method_def(pika_lvgl_bar_get_min_value, 332722052), + method_def(pika_lvgl_bar_get_start_value, 705416206), + method_def(pika_lvgl_bar_get_max_value, 864856070), + method_def(pika_lvgl_bar___init__, 904762485), + method_def(pika_lvgl_bar_set_range, 1128260061), + method_def(pika_lvgl_bar_set_value, 1133002029), + method_def(pika_lvgl_bar_get_value, 1303572769), + method_def(pika_lvgl_bar_set_start_value, 1365569818), + method_def(pika_lvgl_bar_get_mode, 2121602121), +}; +class_inhert(pika_lvgl_bar, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_bar(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_bar); + return self; +} + +Arg *pika_lvgl_bar(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_bar); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_btn___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_btn___init__(self, parent); +} +method_typedef( + pika_lvgl_btn___init__, + "__init__", "parent" +); + +class_def(pika_lvgl_btn){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_btn___init__, 904762485), +}; +class_inhert(pika_lvgl_btn, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_btn(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_btn); + return self; +} + +Arg *pika_lvgl_btn(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_btn); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_checkbox___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_checkbox___init__(self, parent); +} +method_typedef( + pika_lvgl_checkbox___init__, + "__init__", "parent" +); + +void pika_lvgl_checkbox_get_textMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_checkbox_get_text(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_checkbox_get_text, + "get_text", "" +); + +void pika_lvgl_checkbox_set_textMethod(PikaObj *self, Args *args){ + char* txt = args_getStr(args, "txt"); + pika_lvgl_checkbox_set_text(self, txt); +} +method_typedef( + pika_lvgl_checkbox_set_text, + "set_text", "txt" +); + +void pika_lvgl_checkbox_set_text_staticMethod(PikaObj *self, Args *args){ + char* txt = args_getStr(args, "txt"); + pika_lvgl_checkbox_set_text_static(self, txt); +} +method_typedef( + pika_lvgl_checkbox_set_text_static, + "set_text_static", "txt" +); + +class_def(pika_lvgl_checkbox){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_checkbox_set_text, 294567317), + method_def(pika_lvgl_checkbox___init__, 904762485), + method_def(pika_lvgl_checkbox_set_text_static, 1204885116), + method_def(pika_lvgl_checkbox_get_text, 2121843465), +}; +class_inhert(pika_lvgl_checkbox, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_checkbox(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_checkbox); + return self; +} + +Arg *pika_lvgl_checkbox(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_checkbox); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_dropdown___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_dropdown___init__(self, parent); +} +method_typedef( + pika_lvgl_dropdown___init__, + "__init__", "parent" +); + +void pika_lvgl_dropdown_add_optionMethod(PikaObj *self, Args *args){ + char* option = args_getStr(args, "option"); + int pos = args_getInt(args, "pos"); + pika_lvgl_dropdown_add_option(self, option, pos); +} +method_typedef( + pika_lvgl_dropdown_add_option, + "add_option", "option,pos" +); + +void pika_lvgl_dropdown_clear_optionsMethod(PikaObj *self, Args *args){ + pika_lvgl_dropdown_clear_options(self); +} +method_typedef( + pika_lvgl_dropdown_clear_options, + "clear_options", "" +); + +void pika_lvgl_dropdown_closeMethod(PikaObj *self, Args *args){ + pika_lvgl_dropdown_close(self); +} +method_typedef( + pika_lvgl_dropdown_close, + "close", "" +); + +void pika_lvgl_dropdown_get_dirMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_dropdown_get_dir(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_dir, + "get_dir", "" +); + +void pika_lvgl_dropdown_get_option_cntMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_dropdown_get_option_cnt(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_option_cnt, + "get_option_cnt", "" +); + +void pika_lvgl_dropdown_get_option_indexMethod(PikaObj *self, Args *args){ + char* option = args_getStr(args, "option"); + int res = pika_lvgl_dropdown_get_option_index(self, option); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_option_index, + "get_option_index", "option" +); + +void pika_lvgl_dropdown_get_optionsMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_dropdown_get_options(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_options, + "get_options", "" +); + +void pika_lvgl_dropdown_get_selectedMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_dropdown_get_selected(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_selected, + "get_selected", "" +); + +void pika_lvgl_dropdown_get_selected_highlightMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_dropdown_get_selected_highlight(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_selected_highlight, + "get_selected_highlight", "" +); + +void pika_lvgl_dropdown_get_selected_strMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_dropdown_get_selected_str(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_selected_str, + "get_selected_str", "" +); + +void pika_lvgl_dropdown_get_symbolMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_dropdown_get_symbol(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_symbol, + "get_symbol", "" +); + +void pika_lvgl_dropdown_get_textMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_dropdown_get_text(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_dropdown_get_text, + "get_text", "" +); + +void pika_lvgl_dropdown_is_openMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_dropdown_is_open(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_dropdown_is_open, + "is_open", "" +); + +void pika_lvgl_dropdown_openMethod(PikaObj *self, Args *args){ + pika_lvgl_dropdown_open(self); +} +method_typedef( + pika_lvgl_dropdown_open, + "open", "" +); + +void pika_lvgl_dropdown_set_dirMethod(PikaObj *self, Args *args){ + int dir = args_getInt(args, "dir"); + pika_lvgl_dropdown_set_dir(self, dir); +} +method_typedef( + pika_lvgl_dropdown_set_dir, + "set_dir", "dir" +); + +void pika_lvgl_dropdown_set_optionsMethod(PikaObj *self, Args *args){ + char* options = args_getStr(args, "options"); + pika_lvgl_dropdown_set_options(self, options); +} +method_typedef( + pika_lvgl_dropdown_set_options, + "set_options", "options" +); + +void pika_lvgl_dropdown_set_selectedMethod(PikaObj *self, Args *args){ + int sel_opt = args_getInt(args, "sel_opt"); + pika_lvgl_dropdown_set_selected(self, sel_opt); +} +method_typedef( + pika_lvgl_dropdown_set_selected, + "set_selected", "sel_opt" +); + +void pika_lvgl_dropdown_set_selected_hightlightMethod(PikaObj *self, Args *args){ + int en = args_getInt(args, "en"); + pika_lvgl_dropdown_set_selected_hightlight(self, en); +} +method_typedef( + pika_lvgl_dropdown_set_selected_hightlight, + "set_selected_hightlight", "en" +); + +void pika_lvgl_dropdown_set_symbolMethod(PikaObj *self, Args *args){ + char* symbol = args_getStr(args, "symbol"); + pika_lvgl_dropdown_set_symbol(self, symbol); +} +method_typedef( + pika_lvgl_dropdown_set_symbol, + "set_symbol", "symbol" +); + +void pika_lvgl_dropdown_set_textMethod(PikaObj *self, Args *args){ + char* txt = args_getStr(args, "txt"); + pika_lvgl_dropdown_set_text(self, txt); +} +method_typedef( + pika_lvgl_dropdown_set_text, + "set_text", "txt" +); + +class_def(pika_lvgl_dropdown){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_dropdown_set_selected, 102144121), + method_def(pika_lvgl_dropdown_set_dir, 204134767), + method_def(pika_lvgl_dropdown_get_options, 249814576), + method_def(pika_lvgl_dropdown_close, 255564379), + method_def(pika_lvgl_dropdown_set_text, 294567317), + method_def(pika_lvgl_dropdown_add_option, 603419718), + method_def(pika_lvgl_dropdown_is_open, 697936050), + method_def(pika_lvgl_dropdown_set_symbol, 792916550), + method_def(pika_lvgl_dropdown___init__, 904762485), + method_def(pika_lvgl_dropdown_get_selected, 984496109), + method_def(pika_lvgl_dropdown_get_option_cnt, 1104161889), + method_def(pika_lvgl_dropdown_set_selected_hightlight, 1109702884), + method_def(pika_lvgl_dropdown_set_options, 1329356092), + method_def(pika_lvgl_dropdown_get_selected_str, 1441298181), + method_def(pika_lvgl_dropdown_clear_options, 1694821431), + method_def(pika_lvgl_dropdown_get_dir, 1886388323), + method_def(pika_lvgl_dropdown_get_option_index, 1996039444), + method_def(pika_lvgl_dropdown_get_selected_highlight, 2056354148), + method_def(pika_lvgl_dropdown_open, 2090588023), + method_def(pika_lvgl_dropdown_get_text, 2121843465), + method_def(pika_lvgl_dropdown_get_symbol, 2126783674), +}; +class_inhert(pika_lvgl_dropdown, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_dropdown(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_dropdown); + return self; +} + +Arg *pika_lvgl_dropdown(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_dropdown); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_flag_t___init__Method(PikaObj *self, Args *args){ + pika_lvgl_flag_t___init__(self); +} +method_typedef( + pika_lvgl_flag_t___init__, + "__init__", "" +); + +class_def(pika_lvgl_flag_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_flag_t___init__, 904762485), +}; +class_inhert(pika_lvgl_flag_t, TinyObj); + +PikaObj *New_pika_lvgl_flag_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_flag_t); + return self; +} + +Arg *pika_lvgl_flag_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_flag_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_img___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_img___init__(self, parent); +} +method_typedef( + pika_lvgl_img___init__, + "__init__", "parent" +); + +void pika_lvgl_img_get_angleMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_angle(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_angle, + "get_angle", "" +); + +void pika_lvgl_img_get_antialiasMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_antialias(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_antialias, + "get_antialias", "" +); + +void pika_lvgl_img_get_offset_xMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_offset_x(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_offset_x, + "get_offset_x", "" +); + +void pika_lvgl_img_get_offset_yMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_offset_y(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_offset_y, + "get_offset_y", "" +); + +void pika_lvgl_img_get_size_modeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_size_mode(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_size_mode, + "get_size_mode", "" +); + +void pika_lvgl_img_get_srcMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_lvgl_img_get_src(self); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_img_get_src, + "get_src", "" +); + +void pika_lvgl_img_get_zoomMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_img_get_zoom(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_img_get_zoom, + "get_zoom", "" +); + +void pika_lvgl_img_set_angleMethod(PikaObj *self, Args *args){ + int angle = args_getInt(args, "angle"); + pika_lvgl_img_set_angle(self, angle); +} +method_typedef( + pika_lvgl_img_set_angle, + "set_angle", "angle" +); + +void pika_lvgl_img_set_antialiasMethod(PikaObj *self, Args *args){ + int antialias = args_getInt(args, "antialias"); + pika_lvgl_img_set_antialias(self, antialias); +} +method_typedef( + pika_lvgl_img_set_antialias, + "set_antialias", "antialias" +); + +void pika_lvgl_img_set_offset_xMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + pika_lvgl_img_set_offset_x(self, x); +} +method_typedef( + pika_lvgl_img_set_offset_x, + "set_offset_x", "x" +); + +void pika_lvgl_img_set_offset_yMethod(PikaObj *self, Args *args){ + int y = args_getInt(args, "y"); + pika_lvgl_img_set_offset_y(self, y); +} +method_typedef( + pika_lvgl_img_set_offset_y, + "set_offset_y", "y" +); + +void pika_lvgl_img_set_pivotMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + int y = args_getInt(args, "y"); + pika_lvgl_img_set_pivot(self, x, y); +} +method_typedef( + pika_lvgl_img_set_pivot, + "set_pivot", "x,y" +); + +void pika_lvgl_img_set_size_modeMethod(PikaObj *self, Args *args){ + int mode = args_getInt(args, "mode"); + pika_lvgl_img_set_size_mode(self, mode); +} +method_typedef( + pika_lvgl_img_set_size_mode, + "set_size_mode", "mode" +); + +void pika_lvgl_img_set_srcMethod(PikaObj *self, Args *args){ + PikaObj* src = args_getPtr(args, "src"); + pika_lvgl_img_set_src(self, src); +} +method_typedef( + pika_lvgl_img_set_src, + "set_src", "src" +); + +void pika_lvgl_img_set_zoomMethod(PikaObj *self, Args *args){ + int zoom = args_getInt(args, "zoom"); + pika_lvgl_img_set_zoom(self, zoom); +} +method_typedef( + pika_lvgl_img_set_zoom, + "set_zoom", "zoom" +); + +class_def(pika_lvgl_img){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_img_set_src, 204151384), + method_def(pika_lvgl_img_set_zoom, 294793525), + method_def(pika_lvgl_img_set_offset_x, 352910606), + method_def(pika_lvgl_img_set_offset_y, 352910607), + method_def(pika_lvgl_img_get_antialias, 520340730), + method_def(pika_lvgl_img_set_size_mode, 794050543), + method_def(pika_lvgl_img___init__, 904762485), + method_def(pika_lvgl_img_set_angle, 1108559127), + method_def(pika_lvgl_img_set_pivot, 1126184706), + method_def(pika_lvgl_img_get_offset_x, 1235262594), + method_def(pika_lvgl_img_get_offset_y, 1235262595), + method_def(pika_lvgl_img_get_angle, 1279129867), + method_def(pika_lvgl_img_set_antialias, 1467496198), + method_def(pika_lvgl_img_get_src, 1886404940), + method_def(pika_lvgl_img_get_size_mode, 1994378723), + method_def(pika_lvgl_img_get_zoom, 2122069673), +}; +class_inhert(pika_lvgl_img, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_img(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_img); + return self; +} + +Arg *pika_lvgl_img(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_img); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_img_dsc_t___init__Method(PikaObj *self, Args *args){ + PikaObj* dsc_dict = args_getPtr(args, "dsc_dict"); + pika_lvgl_img_dsc_t___init__(self, dsc_dict); +} +method_typedef( + pika_lvgl_img_dsc_t___init__, + "__init__", "dsc_dict" +); + +class_def(pika_lvgl_img_dsc_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_img_dsc_t___init__, 904762485), +}; +class_inhert(pika_lvgl_img_dsc_t, TinyObj); + +PikaObj *New_pika_lvgl_img_dsc_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_img_dsc_t); + return self; +} + +Arg *pika_lvgl_img_dsc_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_img_dsc_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_indev_t_get_vectMethod(PikaObj *self, Args *args){ + PikaObj* point = args_getPtr(args, "point"); + pika_lvgl_indev_t_get_vect(self, point); +} +method_typedef( + pika_lvgl_indev_t_get_vect, + "get_vect", "point" +); + +class_def(pika_lvgl_indev_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_indev_t_get_vect, 2121914646), +}; +class_inhert(pika_lvgl_indev_t, TinyObj); + +PikaObj *New_pika_lvgl_indev_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_indev_t); + return self; +} + +Arg *pika_lvgl_indev_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_indev_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_label___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_label___init__(self, parent); +} +method_typedef( + pika_lvgl_label___init__, + "__init__", "parent" +); + +void pika_lvgl_label_set_long_modeMethod(PikaObj *self, Args *args){ + int mode = args_getInt(args, "mode"); + pika_lvgl_label_set_long_mode(self, mode); +} +method_typedef( + pika_lvgl_label_set_long_mode, + "set_long_mode", "mode" +); + +void pika_lvgl_label_set_recolorMethod(PikaObj *self, Args *args){ + int en = args_getInt(args, "en"); + pika_lvgl_label_set_recolor(self, en); +} +method_typedef( + pika_lvgl_label_set_recolor, + "set_recolor", "en" +); + +void pika_lvgl_label_set_style_text_alignMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + int selector = args_getInt(args, "selector"); + pika_lvgl_label_set_style_text_align(self, value, selector); +} +method_typedef( + pika_lvgl_label_set_style_text_align, + "set_style_text_align", "value,selector" +); + +void pika_lvgl_label_set_textMethod(PikaObj *self, Args *args){ + char* txt = args_getStr(args, "txt"); + pika_lvgl_label_set_text(self, txt); +} +method_typedef( + pika_lvgl_label_set_text, + "set_text", "txt" +); + +class_def(pika_lvgl_label){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_label_set_text, 294567317), + method_def(pika_lvgl_label_set_style_text_align, 342106287), + method_def(pika_lvgl_label_set_recolor, 458355110), + method_def(pika_lvgl_label___init__, 904762485), + method_def(pika_lvgl_label_set_long_mode, 1919393380), +}; +class_inhert(pika_lvgl_label, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_label(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_label); + return self; +} + +Arg *pika_lvgl_label(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_label); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +class_def(pika_lvgl_lv_color_t){ + __BEFORE_MOETHOD_DEF +}; +class_inhert(pika_lvgl_lv_color_t, TinyObj); + +PikaObj *New_pika_lvgl_lv_color_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_lv_color_t); + return self; +} + +Arg *pika_lvgl_lv_color_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_lv_color_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_lv_event_get_codeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_event_get_code(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_event_get_code, + "get_code", "" +); + +void pika_lvgl_lv_event_get_targetMethod(PikaObj *self, Args *args){ + PikaObj* res = pika_lvgl_lv_event_get_target(self); + method_returnObj(args, res); +} +method_typedef( + pika_lvgl_lv_event_get_target, + "get_target", "" +); + +class_def(pika_lvgl_lv_event){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_lv_event_get_code, 2121242751), + method_def(pika_lvgl_lv_event_get_target, 2137641771), +}; +class_inhert(pika_lvgl_lv_event, TinyObj); + +PikaObj *New_pika_lvgl_lv_event(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_lv_event); + return self; +} + +Arg *pika_lvgl_lv_event(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_lv_event); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_lv_obj___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_lv_obj___init__(self, parent); +} +method_typedef( + pika_lvgl_lv_obj___init__, + "__init__", "parent" +); + +void pika_lvgl_lv_obj_add_event_cbMethod(PikaObj *self, Args *args){ + Arg* event_cb = args_getArg(args, "event_cb"); + int filter = args_getInt(args, "filter"); + void* user_data = args_getPtr(args, "user_data"); + pika_lvgl_lv_obj_add_event_cb(self, event_cb, filter, user_data); +} +method_typedef( + pika_lvgl_lv_obj_add_event_cb, + "add_event_cb", "event_cb,filter,user_data" +); + +void pika_lvgl_lv_obj_add_flagMethod(PikaObj *self, Args *args){ + int flag = args_getInt(args, "flag"); + pika_lvgl_lv_obj_add_flag(self, flag); +} +method_typedef( + pika_lvgl_lv_obj_add_flag, + "add_flag", "flag" +); + +void pika_lvgl_lv_obj_add_stateMethod(PikaObj *self, Args *args){ + int state = args_getInt(args, "state"); + pika_lvgl_lv_obj_add_state(self, state); +} +method_typedef( + pika_lvgl_lv_obj_add_state, + "add_state", "state" +); + +void pika_lvgl_lv_obj_add_styleMethod(PikaObj *self, Args *args){ + PikaObj* style = args_getPtr(args, "style"); + int selector = args_getInt(args, "selector"); + pika_lvgl_lv_obj_add_style(self, style, selector); +} +method_typedef( + pika_lvgl_lv_obj_add_style, + "add_style", "style,selector" +); + +void pika_lvgl_lv_obj_alignMethod(PikaObj *self, Args *args){ + int align = args_getInt(args, "align"); + int x_ofs = args_getInt(args, "x_ofs"); + int y_ofs = args_getInt(args, "y_ofs"); + pika_lvgl_lv_obj_align(self, align, x_ofs, y_ofs); +} +method_typedef( + pika_lvgl_lv_obj_align, + "align", "align,x_ofs,y_ofs" +); + +void pika_lvgl_lv_obj_align_toMethod(PikaObj *self, Args *args){ + PikaObj* base = args_getPtr(args, "base"); + int align = args_getInt(args, "align"); + int x_ofs = args_getInt(args, "x_ofs"); + int y_ofs = args_getInt(args, "y_ofs"); + pika_lvgl_lv_obj_align_to(self, base, align, x_ofs, y_ofs); +} +method_typedef( + pika_lvgl_lv_obj_align_to, + "align_to", "base,align,x_ofs,y_ofs" +); + +void pika_lvgl_lv_obj_centerMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_center(self); +} +method_typedef( + pika_lvgl_lv_obj_center, + "center", "" +); + +void pika_lvgl_lv_obj_cleanMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_clean(self); +} +method_typedef( + pika_lvgl_lv_obj_clean, + "clean", "" +); + +void pika_lvgl_lv_obj_clear_flagMethod(PikaObj *self, Args *args){ + int flag = args_getInt(args, "flag"); + pika_lvgl_lv_obj_clear_flag(self, flag); +} +method_typedef( + pika_lvgl_lv_obj_clear_flag, + "clear_flag", "flag" +); + +void pika_lvgl_lv_obj_del_Method(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_del_(self); +} +method_typedef( + pika_lvgl_lv_obj_del_, + "del_", "" +); + +void pika_lvgl_lv_obj_get_content_heightMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_content_height(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_content_height, + "get_content_height", "" +); + +void pika_lvgl_lv_obj_get_content_widthMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_content_width(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_content_width, + "get_content_width", "" +); + +void pika_lvgl_lv_obj_get_heightMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_height(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_height, + "get_height", "" +); + +void pika_lvgl_lv_obj_get_idMethod(PikaObj *self, Args *args){ + char* res = pika_lvgl_lv_obj_get_id(self); + method_returnStr(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_id, + "get_id", "" +); + +void pika_lvgl_lv_obj_get_self_heightMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_self_height(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_self_height, + "get_self_height", "" +); + +void pika_lvgl_lv_obj_get_self_widthMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_self_width(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_self_width, + "get_self_width", "" +); + +void pika_lvgl_lv_obj_get_widthMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_width(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_width, + "get_width", "" +); + +void pika_lvgl_lv_obj_get_xMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_x(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_x, + "get_x", "" +); + +void pika_lvgl_lv_obj_get_x2Method(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_x2(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_x2, + "get_x2", "" +); + +void pika_lvgl_lv_obj_get_x_alignedMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_x_aligned(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_x_aligned, + "get_x_aligned", "" +); + +void pika_lvgl_lv_obj_get_yMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_y(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_y, + "get_y", "" +); + +void pika_lvgl_lv_obj_get_y2Method(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_y2(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_y2, + "get_y2", "" +); + +void pika_lvgl_lv_obj_get_y_alignedMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_get_y_aligned(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_get_y_aligned, + "get_y_aligned", "" +); + +void pika_lvgl_lv_obj_hit_testMethod(PikaObj *self, Args *args){ + PikaObj* point = args_getPtr(args, "point"); + int res = pika_lvgl_lv_obj_hit_test(self, point); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_hit_test, + "hit_test", "point" +); + +void pika_lvgl_lv_obj_invalidateMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_invalidate(self); +} +method_typedef( + pika_lvgl_lv_obj_invalidate, + "invalidate", "" +); + +void pika_lvgl_lv_obj_is_layout_positionedMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_is_layout_positioned(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_is_layout_positioned, + "is_layout_positioned", "" +); + +void pika_lvgl_lv_obj_is_visibleMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_is_visible(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_is_visible, + "is_visible", "" +); + +void pika_lvgl_lv_obj_mark_layout_as_dirtyMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_mark_layout_as_dirty(self); +} +method_typedef( + pika_lvgl_lv_obj_mark_layout_as_dirty, + "mark_layout_as_dirty", "" +); + +void pika_lvgl_lv_obj_move_children_byMethod(PikaObj *self, Args *args){ + int x_diff = args_getInt(args, "x_diff"); + int y_diff = args_getInt(args, "y_diff"); + int ignore_floating = args_getInt(args, "ignore_floating"); + pika_lvgl_lv_obj_move_children_by(self, x_diff, y_diff, ignore_floating); +} +method_typedef( + pika_lvgl_lv_obj_move_children_by, + "move_children_by", "x_diff,y_diff,ignore_floating" +); + +void pika_lvgl_lv_obj_move_toMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + int y = args_getInt(args, "y"); + pika_lvgl_lv_obj_move_to(self, x, y); +} +method_typedef( + pika_lvgl_lv_obj_move_to, + "move_to", "x,y" +); + +void pika_lvgl_lv_obj_refr_posMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_refr_pos(self); +} +method_typedef( + pika_lvgl_lv_obj_refr_pos, + "refr_pos", "" +); + +void pika_lvgl_lv_obj_refr_sizeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_refr_size(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_refr_size, + "refr_size", "" +); + +void pika_lvgl_lv_obj_refresh_self_sizeMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_lv_obj_refresh_self_size(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_lv_obj_refresh_self_size, + "refresh_self_size", "" +); + +void pika_lvgl_lv_obj_set_alignMethod(PikaObj *self, Args *args){ + int align = args_getInt(args, "align"); + pika_lvgl_lv_obj_set_align(self, align); +} +method_typedef( + pika_lvgl_lv_obj_set_align, + "set_align", "align" +); + +void pika_lvgl_lv_obj_set_content_heightMethod(PikaObj *self, Args *args){ + int h = args_getInt(args, "h"); + pika_lvgl_lv_obj_set_content_height(self, h); +} +method_typedef( + pika_lvgl_lv_obj_set_content_height, + "set_content_height", "h" +); + +void pika_lvgl_lv_obj_set_content_widthMethod(PikaObj *self, Args *args){ + int w = args_getInt(args, "w"); + pika_lvgl_lv_obj_set_content_width(self, w); +} +method_typedef( + pika_lvgl_lv_obj_set_content_width, + "set_content_width", "w" +); + +void pika_lvgl_lv_obj_set_ext_click_areaMethod(PikaObj *self, Args *args){ + int size = args_getInt(args, "size"); + pika_lvgl_lv_obj_set_ext_click_area(self, size); +} +method_typedef( + pika_lvgl_lv_obj_set_ext_click_area, + "set_ext_click_area", "size" +); + +void pika_lvgl_lv_obj_set_flex_alignMethod(PikaObj *self, Args *args){ + int main_place = args_getInt(args, "main_place"); + int cross_place = args_getInt(args, "cross_place"); + int align = args_getInt(args, "align"); + pika_lvgl_lv_obj_set_flex_align(self, main_place, cross_place, align); +} +method_typedef( + pika_lvgl_lv_obj_set_flex_align, + "set_flex_align", "main_place,cross_place,align" +); + +void pika_lvgl_lv_obj_set_flex_flowMethod(PikaObj *self, Args *args){ + int flow = args_getInt(args, "flow"); + pika_lvgl_lv_obj_set_flex_flow(self, flow); +} +method_typedef( + pika_lvgl_lv_obj_set_flex_flow, + "set_flex_flow", "flow" +); + +void pika_lvgl_lv_obj_set_flex_growMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_lv_obj_set_flex_grow(self, value); +} +method_typedef( + pika_lvgl_lv_obj_set_flex_grow, + "set_flex_grow", "value" +); + +void pika_lvgl_lv_obj_set_heightMethod(PikaObj *self, Args *args){ + int h = args_getInt(args, "h"); + pika_lvgl_lv_obj_set_height(self, h); +} +method_typedef( + pika_lvgl_lv_obj_set_height, + "set_height", "h" +); + +void pika_lvgl_lv_obj_set_idMethod(PikaObj *self, Args *args){ + char* id = args_getStr(args, "id"); + pika_lvgl_lv_obj_set_id(self, id); +} +method_typedef( + pika_lvgl_lv_obj_set_id, + "set_id", "id" +); + +void pika_lvgl_lv_obj_set_layoutMethod(PikaObj *self, Args *args){ + int layout = args_getInt(args, "layout"); + pika_lvgl_lv_obj_set_layout(self, layout); +} +method_typedef( + pika_lvgl_lv_obj_set_layout, + "set_layout", "layout" +); + +void pika_lvgl_lv_obj_set_posMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + int y = args_getInt(args, "y"); + pika_lvgl_lv_obj_set_pos(self, x, y); +} +method_typedef( + pika_lvgl_lv_obj_set_pos, + "set_pos", "x,y" +); + +void pika_lvgl_lv_obj_set_sizeMethod(PikaObj *self, Args *args){ + int w = args_getInt(args, "w"); + int h = args_getInt(args, "h"); + pika_lvgl_lv_obj_set_size(self, w, h); +} +method_typedef( + pika_lvgl_lv_obj_set_size, + "set_size", "w,h" +); + +void pika_lvgl_lv_obj_set_widthMethod(PikaObj *self, Args *args){ + int w = args_getInt(args, "w"); + pika_lvgl_lv_obj_set_width(self, w); +} +method_typedef( + pika_lvgl_lv_obj_set_width, + "set_width", "w" +); + +void pika_lvgl_lv_obj_set_xMethod(PikaObj *self, Args *args){ + int x = args_getInt(args, "x"); + pika_lvgl_lv_obj_set_x(self, x); +} +method_typedef( + pika_lvgl_lv_obj_set_x, + "set_x", "x" +); + +void pika_lvgl_lv_obj_set_yMethod(PikaObj *self, Args *args){ + int y = args_getInt(args, "y"); + pika_lvgl_lv_obj_set_y(self, y); +} +method_typedef( + pika_lvgl_lv_obj_set_y, + "set_y", "y" +); + +void pika_lvgl_lv_obj_transform_pointMethod(PikaObj *self, Args *args){ + PikaObj* p = args_getPtr(args, "p"); + int recursive = args_getInt(args, "recursive"); + int inv = args_getInt(args, "inv"); + pika_lvgl_lv_obj_transform_point(self, p, recursive, inv); +} +method_typedef( + pika_lvgl_lv_obj_transform_point, + "transform_point", "p,recursive,inv" +); + +void pika_lvgl_lv_obj_update_layoutMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_obj_update_layout(self); +} +method_typedef( + pika_lvgl_lv_obj_update_layout, + "update_layout", "" +); + +class_def(pika_lvgl_lv_obj){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_lv_obj_invalidate, 3591110), + method_def(pika_lvgl_lv_obj_add_flag, 43609191), + method_def(pika_lvgl_lv_obj_set_ext_click_area, 60312958), + method_def(pika_lvgl_lv_obj_get_y_aligned, 63829840), + method_def(pika_lvgl_lv_obj_refr_pos, 99691301), + method_def(pika_lvgl_lv_obj_set_content_width, 137436842), + method_def(pika_lvgl_lv_obj_set_pos, 204148034), + method_def(pika_lvgl_lv_obj_align, 253185616), + method_def(pika_lvgl_lv_obj_clean, 255552904), + method_def(pika_lvgl_lv_obj_get_x_aligned, 257001039), + method_def(pika_lvgl_lv_obj_get_x, 260061308), + method_def(pika_lvgl_lv_obj_get_y, 260061309), + method_def(pika_lvgl_lv_obj_set_x, 274292360), + method_def(pika_lvgl_lv_obj_set_y, 274292361), + method_def(pika_lvgl_lv_obj_set_size, 294535787), + method_def(pika_lvgl_lv_obj_refresh_self_size, 302518935), + method_def(pika_lvgl_lv_obj_set_height, 338570281), + method_def(pika_lvgl_lv_obj_set_flex_align, 387549385), + method_def(pika_lvgl_lv_obj_mark_layout_as_dirty, 392460491), + method_def(pika_lvgl_lv_obj_set_id, 461712893), + method_def(pika_lvgl_lv_obj_set_layout, 490952302), + method_def(pika_lvgl_lv_obj_hit_test, 514034249), + method_def(pika_lvgl_lv_obj_get_self_height, 519588102), + method_def(pika_lvgl_lv_obj_is_layout_positioned, 587518683), + method_def(pika_lvgl_lv_obj_get_content_width, 637175454), + method_def(pika_lvgl_lv_obj___init__, 904762485), + method_def(pika_lvgl_lv_obj_get_content_height, 1107828215), + method_def(pika_lvgl_lv_obj_set_align, 1108489275), + method_def(pika_lvgl_lv_obj_set_width, 1134466704), + method_def(pika_lvgl_lv_obj_refr_size, 1142430894), + method_def(pika_lvgl_lv_obj_get_width, 1305037444), + method_def(pika_lvgl_lv_obj_update_layout, 1348517285), + method_def(pika_lvgl_lv_obj_move_children_by, 1406194782), + method_def(pika_lvgl_lv_obj_move_to, 1439197854), + method_def(pika_lvgl_lv_obj_add_state, 1454808302), + method_def(pika_lvgl_lv_obj_add_style, 1454834174), + method_def(pika_lvgl_lv_obj_is_visible, 1459230894), + method_def(pika_lvgl_lv_obj_clear_flag, 1542104037), + method_def(pika_lvgl_lv_obj_get_self_width, 1660554189), + method_def(pika_lvgl_lv_obj_get_height, 1672437405), + method_def(pika_lvgl_lv_obj_set_flex_flow, 1703880630), + method_def(pika_lvgl_lv_obj_set_flex_grow, 1703923101), + method_def(pika_lvgl_lv_obj_set_content_height, 1796323203), + method_def(pika_lvgl_lv_obj_add_event_cb, 1884315091), + method_def(pika_lvgl_lv_obj_center, 1982837382), + method_def(pika_lvgl_lv_obj_align_to, 1990856658), + method_def(pika_lvgl_lv_obj_transform_point, 2082582986), + method_def(pika_lvgl_lv_obj_del_, 2090180953), + method_def(pika_lvgl_lv_obj_get_id, 2139571825), + method_def(pika_lvgl_lv_obj_get_x2, 2139572270), + method_def(pika_lvgl_lv_obj_get_y2, 2139572303), +}; +class_inhert(pika_lvgl_lv_obj, TinyObj); + +PikaObj *New_pika_lvgl_lv_obj(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_lv_obj); + return self; +} + +Arg *pika_lvgl_lv_obj(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_lv_obj); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_lv_timer_t__delMethod(PikaObj *self, Args *args){ + pika_lvgl_lv_timer_t__del(self); +} +method_typedef( + pika_lvgl_lv_timer_t__del, + "_del", "" +); + +void pika_lvgl_lv_timer_t_set_cbMethod(PikaObj *self, Args *args){ + Arg* cb = args_getArg(args, "cb"); + pika_lvgl_lv_timer_t_set_cb(self, cb); +} +method_typedef( + pika_lvgl_lv_timer_t_set_cb, + "set_cb", "cb" +); + +void pika_lvgl_lv_timer_t_set_periodMethod(PikaObj *self, Args *args){ + int period = args_getInt(args, "period"); + pika_lvgl_lv_timer_t_set_period(self, period); +} +method_typedef( + pika_lvgl_lv_timer_t_set_period, + "set_period", "period" +); + +class_def(pika_lvgl_lv_timer_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_lv_timer_t_set_cb, 461712693), + method_def(pika_lvgl_lv_timer_t_set_period, 651979251), + method_def(pika_lvgl_lv_timer_t__del, 2089999961), +}; +class_inhert(pika_lvgl_lv_timer_t, TinyObj); + +PikaObj *New_pika_lvgl_lv_timer_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_lv_timer_t); + return self; +} + +Arg *pika_lvgl_lv_timer_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_lv_timer_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_obj___init__Method(PikaObj *self, Args *args){ + PikaTuple* parent = args_getTuple(args, "parent"); + pika_lvgl_obj___init__(self, parent); +} +method_typedef( + pika_lvgl_obj___init__, + "__init__", "*parent" +); + +class_def(pika_lvgl_obj){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_obj___init__, 904762485), +}; +class_inhert(pika_lvgl_obj, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_obj(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_obj); + return self; +} + +Arg *pika_lvgl_obj(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_obj); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_point_t___init__Method(PikaObj *self, Args *args){ + pika_lvgl_point_t___init__(self); +} +method_typedef( + pika_lvgl_point_t___init__, + "__init__", "" +); + +class_def(pika_lvgl_point_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_point_t___init__, 904762485), +}; +class_inhert(pika_lvgl_point_t, TinyObj); + +PikaObj *New_pika_lvgl_point_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_point_t); + return self; +} + +Arg *pika_lvgl_point_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_point_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_roller___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_roller___init__(self, parent); +} +method_typedef( + pika_lvgl_roller___init__, + "__init__", "parent" +); + +void pika_lvgl_roller_set_optionsMethod(PikaObj *self, Args *args){ + char* options = args_getStr(args, "options"); + int mode = args_getInt(args, "mode"); + pika_lvgl_roller_set_options(self, options, mode); +} +method_typedef( + pika_lvgl_roller_set_options, + "set_options", "options,mode" +); + +void pika_lvgl_roller_set_visible_row_countMethod(PikaObj *self, Args *args){ + int row_cnt = args_getInt(args, "row_cnt"); + pika_lvgl_roller_set_visible_row_count(self, row_cnt); +} +method_typedef( + pika_lvgl_roller_set_visible_row_count, + "set_visible_row_count", "row_cnt" +); + +class_def(pika_lvgl_roller){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_roller___init__, 904762485), + method_def(pika_lvgl_roller_set_visible_row_count, 1296618621), + method_def(pika_lvgl_roller_set_options, 1329356092), +}; +class_inhert(pika_lvgl_roller, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_roller(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_roller); + return self; +} + +Arg *pika_lvgl_roller(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_roller); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_slider___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_slider___init__(self, parent); +} +method_typedef( + pika_lvgl_slider___init__, + "__init__", "parent" +); + +class_def(pika_lvgl_slider){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_slider___init__, 904762485), +}; +class_inhert(pika_lvgl_slider, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_slider(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_slider); + return self; +} + +Arg *pika_lvgl_slider(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_slider); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_style_t___init__Method(PikaObj *self, Args *args){ + pika_lvgl_style_t___init__(self); +} +method_typedef( + pika_lvgl_style_t___init__, + "__init__", "" +); + +void pika_lvgl_style_t_get_num_custom_propsMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_style_t_get_num_custom_props(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_style_t_get_num_custom_props, + "get_num_custom_props", "" +); + +void pika_lvgl_style_t_initMethod(PikaObj *self, Args *args){ + pika_lvgl_style_t_init(self); +} +method_typedef( + pika_lvgl_style_t_init, + "init", "" +); + +void pika_lvgl_style_t_is_emptyMethod(PikaObj *self, Args *args){ + int res = pika_lvgl_style_t_is_empty(self); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_style_t_is_empty, + "is_empty", "" +); + +void pika_lvgl_style_t_prop_has_flagMethod(PikaObj *self, Args *args){ + int prop = args_getInt(args, "prop"); + int flag = args_getInt(args, "flag"); + int res = pika_lvgl_style_t_prop_has_flag(self, prop, flag); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_style_t_prop_has_flag, + "prop_has_flag", "prop,flag" +); + +void pika_lvgl_style_t_register_propMethod(PikaObj *self, Args *args){ + int flag = args_getInt(args, "flag"); + int res = pika_lvgl_style_t_register_prop(self, flag); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_style_t_register_prop, + "register_prop", "flag" +); + +void pika_lvgl_style_t_remove_propMethod(PikaObj *self, Args *args){ + int prop = args_getInt(args, "prop"); + int res = pika_lvgl_style_t_remove_prop(self, prop); + method_returnInt(args, res); +} +method_typedef( + pika_lvgl_style_t_remove_prop, + "remove_prop", "prop" +); + +void pika_lvgl_style_t_resetMethod(PikaObj *self, Args *args){ + pika_lvgl_style_t_reset(self); +} +method_typedef( + pika_lvgl_style_t_reset, + "reset", "" +); + +void pika_lvgl_style_t_set_alignMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_align(self, value); +} +method_typedef( + pika_lvgl_style_t_set_align, + "set_align", "value" +); + +void pika_lvgl_style_t_set_anim_speedMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_anim_speed(self, value); +} +method_typedef( + pika_lvgl_style_t_set_anim_speed, + "set_anim_speed", "value" +); + +void pika_lvgl_style_t_set_anim_timeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_anim_time(self, value); +} +method_typedef( + pika_lvgl_style_t_set_anim_time, + "set_anim_time", "value" +); + +void pika_lvgl_style_t_set_arc_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_arc_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_arc_color, + "set_arc_color", "value" +); + +void pika_lvgl_style_t_set_arc_img_srcMethod(PikaObj *self, Args *args){ + uint8_t* value = args_getBytes(args, "value"); + pika_lvgl_style_t_set_arc_img_src(self, value); +} +method_typedef( + pika_lvgl_style_t_set_arc_img_src, + "set_arc_img_src", "value" +); + +void pika_lvgl_style_t_set_arc_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_arc_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_arc_opa, + "set_arc_opa", "value" +); + +void pika_lvgl_style_t_set_arc_roundedMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_arc_rounded(self, value); +} +method_typedef( + pika_lvgl_style_t_set_arc_rounded, + "set_arc_rounded", "value" +); + +void pika_lvgl_style_t_set_arc_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_arc_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_arc_width, + "set_arc_width", "value" +); + +void pika_lvgl_style_t_set_base_dirMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_base_dir(self, value); +} +method_typedef( + pika_lvgl_style_t_set_base_dir, + "set_base_dir", "value" +); + +void pika_lvgl_style_t_set_bg_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_bg_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_color, + "set_bg_color", "value" +); + +void pika_lvgl_style_t_set_bg_dither_modeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_dither_mode(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_dither_mode, + "set_bg_dither_mode", "value" +); + +void pika_lvgl_style_t_set_bg_grad_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_bg_grad_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_grad_color, + "set_bg_grad_color", "value" +); + +void pika_lvgl_style_t_set_bg_grad_dirMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_grad_dir(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_grad_dir, + "set_bg_grad_dir", "value" +); + +void pika_lvgl_style_t_set_bg_grad_stopMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_grad_stop(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_grad_stop, + "set_bg_grad_stop", "value" +); + +void pika_lvgl_style_t_set_bg_img_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_img_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_img_opa, + "set_bg_img_opa", "value" +); + +void pika_lvgl_style_t_set_bg_img_recolorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_bg_img_recolor(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_img_recolor, + "set_bg_img_recolor", "value" +); + +void pika_lvgl_style_t_set_bg_img_recolor_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_img_recolor_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_img_recolor_opa, + "set_bg_img_recolor_opa", "value" +); + +void pika_lvgl_style_t_set_bg_img_srcMethod(PikaObj *self, Args *args){ + uint8_t* value = args_getBytes(args, "value"); + pika_lvgl_style_t_set_bg_img_src(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_img_src, + "set_bg_img_src", "value" +); + +void pika_lvgl_style_t_set_bg_img_tiledMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_img_tiled(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_img_tiled, + "set_bg_img_tiled", "value" +); + +void pika_lvgl_style_t_set_bg_main_stopMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_main_stop(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_main_stop, + "set_bg_main_stop", "value" +); + +void pika_lvgl_style_t_set_bg_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_bg_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_bg_opa, + "set_bg_opa", "value" +); + +void pika_lvgl_style_t_set_blend_modeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_blend_mode(self, value); +} +method_typedef( + pika_lvgl_style_t_set_blend_mode, + "set_blend_mode", "value" +); + +void pika_lvgl_style_t_set_border_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_border_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_border_color, + "set_border_color", "value" +); + +void pika_lvgl_style_t_set_border_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_border_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_border_opa, + "set_border_opa", "value" +); + +void pika_lvgl_style_t_set_border_postMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_border_post(self, value); +} +method_typedef( + pika_lvgl_style_t_set_border_post, + "set_border_post", "value" +); + +void pika_lvgl_style_t_set_border_sideMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_border_side(self, value); +} +method_typedef( + pika_lvgl_style_t_set_border_side, + "set_border_side", "value" +); + +void pika_lvgl_style_t_set_border_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_border_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_border_width, + "set_border_width", "value" +); + +void pika_lvgl_style_t_set_clip_cornerMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_clip_corner(self, value); +} +method_typedef( + pika_lvgl_style_t_set_clip_corner, + "set_clip_corner", "value" +); + +void pika_lvgl_style_t_set_color_filter_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_color_filter_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_color_filter_opa, + "set_color_filter_opa", "value" +); + +void pika_lvgl_style_t_set_flex_cross_placeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_flex_cross_place(self, value); +} +method_typedef( + pika_lvgl_style_t_set_flex_cross_place, + "set_flex_cross_place", "value" +); + +void pika_lvgl_style_t_set_flex_flowMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_flex_flow(self, value); +} +method_typedef( + pika_lvgl_style_t_set_flex_flow, + "set_flex_flow", "value" +); + +void pika_lvgl_style_t_set_flex_growMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_flex_grow(self, value); +} +method_typedef( + pika_lvgl_style_t_set_flex_grow, + "set_flex_grow", "value" +); + +void pika_lvgl_style_t_set_flex_main_placeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_flex_main_place(self, value); +} +method_typedef( + pika_lvgl_style_t_set_flex_main_place, + "set_flex_main_place", "value" +); + +void pika_lvgl_style_t_set_flex_track_placeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_flex_track_place(self, value); +} +method_typedef( + pika_lvgl_style_t_set_flex_track_place, + "set_flex_track_place", "value" +); + +void pika_lvgl_style_t_set_heightMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_height(self, value); +} +method_typedef( + pika_lvgl_style_t_set_height, + "set_height", "value" +); + +void pika_lvgl_style_t_set_img_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_img_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_img_opa, + "set_img_opa", "value" +); + +void pika_lvgl_style_t_set_img_recolorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_img_recolor(self, value); +} +method_typedef( + pika_lvgl_style_t_set_img_recolor, + "set_img_recolor", "value" +); + +void pika_lvgl_style_t_set_img_recolor_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_img_recolor_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_img_recolor_opa, + "set_img_recolor_opa", "value" +); + +void pika_lvgl_style_t_set_layoutMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_layout(self, value); +} +method_typedef( + pika_lvgl_style_t_set_layout, + "set_layout", "value" +); + +void pika_lvgl_style_t_set_line_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_line_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_color, + "set_line_color", "value" +); + +void pika_lvgl_style_t_set_line_dash_gapMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_line_dash_gap(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_dash_gap, + "set_line_dash_gap", "value" +); + +void pika_lvgl_style_t_set_line_dash_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_line_dash_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_dash_width, + "set_line_dash_width", "value" +); + +void pika_lvgl_style_t_set_line_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_line_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_opa, + "set_line_opa", "value" +); + +void pika_lvgl_style_t_set_line_roundedMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_line_rounded(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_rounded, + "set_line_rounded", "value" +); + +void pika_lvgl_style_t_set_line_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_line_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_line_width, + "set_line_width", "value" +); + +void pika_lvgl_style_t_set_max_heightMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_max_height(self, value); +} +method_typedef( + pika_lvgl_style_t_set_max_height, + "set_max_height", "value" +); + +void pika_lvgl_style_t_set_max_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_max_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_max_width, + "set_max_width", "value" +); + +void pika_lvgl_style_t_set_min_heightMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_min_height(self, value); +} +method_typedef( + pika_lvgl_style_t_set_min_height, + "set_min_height", "value" +); + +void pika_lvgl_style_t_set_min_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_min_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_min_width, + "set_min_width", "value" +); + +void pika_lvgl_style_t_set_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_opa, + "set_opa", "value" +); + +void pika_lvgl_style_t_set_outline_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_outline_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_outline_color, + "set_outline_color", "value" +); + +void pika_lvgl_style_t_set_outline_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_outline_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_outline_opa, + "set_outline_opa", "value" +); + +void pika_lvgl_style_t_set_outline_padMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_outline_pad(self, value); +} +method_typedef( + pika_lvgl_style_t_set_outline_pad, + "set_outline_pad", "value" +); + +void pika_lvgl_style_t_set_outline_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_outline_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_outline_width, + "set_outline_width", "value" +); + +void pika_lvgl_style_t_set_pad_allMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_all(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_all, + "set_pad_all", "value" +); + +void pika_lvgl_style_t_set_pad_bottomMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_bottom(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_bottom, + "set_pad_bottom", "value" +); + +void pika_lvgl_style_t_set_pad_columnMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_column(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_column, + "set_pad_column", "value" +); + +void pika_lvgl_style_t_set_pad_gapMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_gap(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_gap, + "set_pad_gap", "value" +); + +void pika_lvgl_style_t_set_pad_horMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_hor(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_hor, + "set_pad_hor", "value" +); + +void pika_lvgl_style_t_set_pad_leftMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_left(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_left, + "set_pad_left", "value" +); + +void pika_lvgl_style_t_set_pad_rightMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_right(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_right, + "set_pad_right", "value" +); + +void pika_lvgl_style_t_set_pad_rowMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_row(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_row, + "set_pad_row", "value" +); + +void pika_lvgl_style_t_set_pad_topMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_top(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_top, + "set_pad_top", "value" +); + +void pika_lvgl_style_t_set_pad_verMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_pad_ver(self, value); +} +method_typedef( + pika_lvgl_style_t_set_pad_ver, + "set_pad_ver", "value" +); + +void pika_lvgl_style_t_set_radiusMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_radius(self, value); +} +method_typedef( + pika_lvgl_style_t_set_radius, + "set_radius", "value" +); + +void pika_lvgl_style_t_set_shadow_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_shadow_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_color, + "set_shadow_color", "value" +); + +void pika_lvgl_style_t_set_shadow_ofs_xMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_shadow_ofs_x(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_ofs_x, + "set_shadow_ofs_x", "value" +); + +void pika_lvgl_style_t_set_shadow_ofs_yMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_shadow_ofs_y(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_ofs_y, + "set_shadow_ofs_y", "value" +); + +void pika_lvgl_style_t_set_shadow_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_shadow_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_opa, + "set_shadow_opa", "value" +); + +void pika_lvgl_style_t_set_shadow_spreadMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_shadow_spread(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_spread, + "set_shadow_spread", "value" +); + +void pika_lvgl_style_t_set_shadow_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_shadow_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_shadow_width, + "set_shadow_width", "value" +); + +void pika_lvgl_style_t_set_sizeMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_size(self, value); +} +method_typedef( + pika_lvgl_style_t_set_size, + "set_size", "value" +); + +void pika_lvgl_style_t_set_text_alignMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_text_align(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_align, + "set_text_align", "value" +); + +void pika_lvgl_style_t_set_text_colorMethod(PikaObj *self, Args *args){ + PikaObj* value = args_getPtr(args, "value"); + pika_lvgl_style_t_set_text_color(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_color, + "set_text_color", "value" +); + +void pika_lvgl_style_t_set_text_decorMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_text_decor(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_decor, + "set_text_decor", "value" +); + +void pika_lvgl_style_t_set_text_letter_spaceMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_text_letter_space(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_letter_space, + "set_text_letter_space", "value" +); + +void pika_lvgl_style_t_set_text_line_spaceMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_text_line_space(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_line_space, + "set_text_line_space", "value" +); + +void pika_lvgl_style_t_set_text_opaMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_text_opa(self, value); +} +method_typedef( + pika_lvgl_style_t_set_text_opa, + "set_text_opa", "value" +); + +void pika_lvgl_style_t_set_transform_angleMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_angle(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_angle, + "set_transform_angle", "value" +); + +void pika_lvgl_style_t_set_transform_heightMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_height(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_height, + "set_transform_height", "value" +); + +void pika_lvgl_style_t_set_transform_pivot_xMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_pivot_x(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_pivot_x, + "set_transform_pivot_x", "value" +); + +void pika_lvgl_style_t_set_transform_pivot_yMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_pivot_y(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_pivot_y, + "set_transform_pivot_y", "value" +); + +void pika_lvgl_style_t_set_transform_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_width, + "set_transform_width", "value" +); + +void pika_lvgl_style_t_set_transform_zoomMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_transform_zoom(self, value); +} +method_typedef( + pika_lvgl_style_t_set_transform_zoom, + "set_transform_zoom", "value" +); + +void pika_lvgl_style_t_set_translate_xMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_translate_x(self, value); +} +method_typedef( + pika_lvgl_style_t_set_translate_x, + "set_translate_x", "value" +); + +void pika_lvgl_style_t_set_translate_yMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_translate_y(self, value); +} +method_typedef( + pika_lvgl_style_t_set_translate_y, + "set_translate_y", "value" +); + +void pika_lvgl_style_t_set_widthMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_width(self, value); +} +method_typedef( + pika_lvgl_style_t_set_width, + "set_width", "value" +); + +void pika_lvgl_style_t_set_xMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_x(self, value); +} +method_typedef( + pika_lvgl_style_t_set_x, + "set_x", "value" +); + +void pika_lvgl_style_t_set_yMethod(PikaObj *self, Args *args){ + int value = args_getInt(args, "value"); + pika_lvgl_style_t_set_y(self, value); +} +method_typedef( + pika_lvgl_style_t_set_y, + "set_y", "value" +); + +class_def(pika_lvgl_style_t){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_style_t_set_bg_grad_stop, 101336795), + method_def(pika_lvgl_style_t_set_bg_opa, 105779352), + method_def(pika_lvgl_style_t_set_transform_angle, 147403954), + method_def(pika_lvgl_style_t_set_transform_width, 173311531), + method_def(pika_lvgl_style_t_set_opa, 204146960), + method_def(pika_lvgl_style_t_set_text_opa, 258178836), + method_def(pika_lvgl_style_t_set_bg_main_stop, 263931458), + method_def(pika_lvgl_style_t_reset, 273105544), + method_def(pika_lvgl_style_t_set_x, 274292360), + method_def(pika_lvgl_style_t_set_y, 274292361), + method_def(pika_lvgl_style_t_set_blend_mode, 279913561), + method_def(pika_lvgl_style_t_set_size, 294535787), + method_def(pika_lvgl_style_t_set_anim_time, 300708035), + method_def(pika_lvgl_style_t_set_height, 338570281), + method_def(pika_lvgl_style_t_get_num_custom_props, 355535745), + method_def(pika_lvgl_style_t_set_bg_img_tiled, 358876486), + method_def(pika_lvgl_style_t_set_arc_img_src, 431511337), + method_def(pika_lvgl_style_t_set_bg_grad_dir, 458580948), + method_def(pika_lvgl_style_t_set_arc_opa, 486424517), + method_def(pika_lvgl_style_t_set_layout, 490952302), + method_def(pika_lvgl_style_t_set_bg_dither_mode, 496048092), + method_def(pika_lvgl_style_t_set_color_filter_opa, 508949203), + method_def(pika_lvgl_style_t_set_img_recolor, 608047938), + method_def(pika_lvgl_style_t_set_text_line_space, 675833767), + method_def(pika_lvgl_style_t_set_radius, 725003448), + method_def(pika_lvgl_style_t_set_outline_opa, 783690479), + method_def(pika_lvgl_style_t_set_outline_pad, 783691076), + method_def(pika_lvgl_style_t_set_flex_main_place, 810763239), + method_def(pika_lvgl_style_t_set_transform_height, 832704292), + method_def(pika_lvgl_style_t_set_base_dir, 840968681), + method_def(pika_lvgl_style_t_set_border_color, 841342988), + method_def(pika_lvgl_style_t_set_border_width, 864837229), + method_def(pika_lvgl_style_t_set_outline_color, 873672142), + method_def(pika_lvgl_style_t_set_min_height, 890494188), + method_def(pika_lvgl_style_t_set_outline_width, 897166383), + method_def(pika_lvgl_style_t___init__, 904762485), + method_def(pika_lvgl_style_t_register_prop, 927701706), + method_def(pika_lvgl_style_t_set_align, 1108489275), + method_def(pika_lvgl_style_t_set_line_dash_width, 1129934934), + method_def(pika_lvgl_style_t_set_shadow_color, 1132985364), + method_def(pika_lvgl_style_t_set_width, 1134466704), + method_def(pika_lvgl_style_t_set_shadow_ofs_x, 1146900084), + method_def(pika_lvgl_style_t_set_shadow_ofs_y, 1146900085), + method_def(pika_lvgl_style_t_set_shadow_width, 1156479605), + method_def(pika_lvgl_style_t_set_pad_right, 1168480290), + method_def(pika_lvgl_style_t_set_bg_grad_color, 1177472980), + method_def(pika_lvgl_style_t_set_text_letter_space, 1213071919), + method_def(pika_lvgl_style_t_set_line_opa, 1222296887), + method_def(pika_lvgl_style_t_set_max_height, 1271047598), + method_def(pika_lvgl_style_t_set_min_width, 1281342195), + method_def(pika_lvgl_style_t_set_flex_track_place, 1319252791), + method_def(pika_lvgl_style_t_set_anim_speed, 1332487589), + method_def(pika_lvgl_style_t_set_bg_color, 1362829751), + method_def(pika_lvgl_style_t_set_arc_rounded, 1412700790), + method_def(pika_lvgl_style_t_set_arc_color, 1421070372), + method_def(pika_lvgl_style_t_set_bg_img_opa, 1431980084), + method_def(pika_lvgl_style_t_set_bg_img_src, 1431984508), + method_def(pika_lvgl_style_t_set_pad_bottom, 1434056985), + method_def(pika_lvgl_style_t_set_arc_width, 1444564613), + method_def(pika_lvgl_style_t_set_pad_column, 1472905906), + method_def(pika_lvgl_style_t_set_transform_pivot_x, 1476021908), + method_def(pika_lvgl_style_t_set_transform_pivot_y, 1476021909), + method_def(pika_lvgl_style_t_set_shadow_spread, 1508851476), + method_def(pika_lvgl_style_t_set_bg_img_recolor, 1519657674), + method_def(pika_lvgl_style_t_set_border_post, 1522693683), + method_def(pika_lvgl_style_t_set_border_side, 1522794450), + method_def(pika_lvgl_style_t_is_empty, 1545098447), + method_def(pika_lvgl_style_t_remove_prop, 1582082643), + method_def(pika_lvgl_style_t_set_clip_corner, 1593656928), + method_def(pika_lvgl_style_t_set_transform_zoom, 1697323376), + method_def(pika_lvgl_style_t_set_flex_flow, 1703880630), + method_def(pika_lvgl_style_t_set_flex_grow, 1703923101), + method_def(pika_lvgl_style_t_set_line_color, 1774680598), + method_def(pika_lvgl_style_t_set_line_width, 1798174839), + method_def(pika_lvgl_style_t_set_shadow_opa, 1811328949), + method_def(pika_lvgl_style_t_set_max_width, 1813476213), + method_def(pika_lvgl_style_t_set_translate_x, 1837911061), + method_def(pika_lvgl_style_t_set_translate_y, 1837911062), + method_def(pika_lvgl_style_t_set_border_opa, 1868248493), + method_def(pika_lvgl_style_t_set_img_recolor_opa, 1877992257), + method_def(pika_lvgl_style_t_set_line_dash_gap, 1907922286), + method_def(pika_lvgl_style_t_set_text_align, 1967143743), + method_def(pika_lvgl_style_t_set_text_color, 1969626931), + method_def(pika_lvgl_style_t_set_text_decor, 1970443681), + method_def(pika_lvgl_style_t_set_pad_all, 2014443741), + method_def(pika_lvgl_style_t_set_pad_gap, 2014449916), + method_def(pika_lvgl_style_t_set_pad_hor, 2014451469), + method_def(pika_lvgl_style_t_set_pad_row, 2014462364), + method_def(pika_lvgl_style_t_set_pad_top, 2014464535), + method_def(pika_lvgl_style_t_set_pad_ver, 2014466385), + method_def(pika_lvgl_style_t_set_img_opa, 2037300396), + method_def(pika_lvgl_style_t_set_bg_img_recolor_opa, 2052224713), + method_def(pika_lvgl_style_t_set_pad_left, 2052521615), + method_def(pika_lvgl_style_t_init, 2090370361), + method_def(pika_lvgl_style_t_set_line_rounded, 2094663912), + method_def(pika_lvgl_style_t_prop_has_flag, 2108733306), + method_def(pika_lvgl_style_t_set_flex_cross_place, 2117569548), +}; +class_inhert(pika_lvgl_style_t, TinyObj); + +PikaObj *New_pika_lvgl_style_t(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, pika_lvgl_style_t); + return self; +} + +Arg *pika_lvgl_style_t(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_style_t); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_switch___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_switch___init__(self, parent); +} +method_typedef( + pika_lvgl_switch___init__, + "__init__", "parent" +); + +class_def(pika_lvgl_switch){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_switch___init__, 904762485), +}; +class_inhert(pika_lvgl_switch, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_switch(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_switch); + return self; +} + +Arg *pika_lvgl_switch(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_switch); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_table___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_table___init__(self, parent); +} +method_typedef( + pika_lvgl_table___init__, + "__init__", "parent" +); + +void pika_lvgl_table_set_cell_valueMethod(PikaObj *self, Args *args){ + int row = args_getInt(args, "row"); + int col = args_getInt(args, "col"); + char* txt = args_getStr(args, "txt"); + pika_lvgl_table_set_cell_value(self, row, col, txt); +} +method_typedef( + pika_lvgl_table_set_cell_value, + "set_cell_value", "row,col,txt" +); + +class_def(pika_lvgl_table){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_table___init__, 904762485), + method_def(pika_lvgl_table_set_cell_value, 924500076), +}; +class_inhert(pika_lvgl_table, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_table(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_table); + return self; +} + +Arg *pika_lvgl_table(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_table); +} +#endif + +#ifndef PIKA_MODULE_PIKA_LVGL_DISABLE +void pika_lvgl_textarea___init__Method(PikaObj *self, Args *args){ + PikaObj* parent = args_getPtr(args, "parent"); + pika_lvgl_textarea___init__(self, parent); +} +method_typedef( + pika_lvgl_textarea___init__, + "__init__", "parent" +); + +void pika_lvgl_textarea_set_one_lineMethod(PikaObj *self, Args *args){ + int en = args_getInt(args, "en"); + pika_lvgl_textarea_set_one_line(self, en); +} +method_typedef( + pika_lvgl_textarea_set_one_line, + "set_one_line", "en" +); + +class_def(pika_lvgl_textarea){ + __BEFORE_MOETHOD_DEF + method_def(pika_lvgl_textarea___init__, 904762485), + method_def(pika_lvgl_textarea_set_one_line, 2032106009), +}; +class_inhert(pika_lvgl_textarea, pika_lvgl_lv_obj); + +PikaObj *New_pika_lvgl_textarea(Args *args){ + PikaObj *self = New_pika_lvgl_lv_obj(args); + obj_setClass(self, pika_lvgl_textarea); + return self; +} + +Arg *pika_lvgl_textarea(PikaObj *self){ + return obj_newObjInPackage(New_pika_lvgl_textarea); +} +#endif + +#ifndef PIKA_MODULE_RANDOM_DISABLE +void random___init__Method(PikaObj *self, Args *args){ + random___init__(self); +} +method_typedef( + random___init__, + "__init__", "" +); + +void random_randintMethod(PikaObj *self, Args *args){ + int a = args_getInt(args, "a"); + int b = args_getInt(args, "b"); + int res = random_randint(self, a, b); + method_returnInt(args, res); +} +method_typedef( + random_randint, + "randint", "a,b" +); + +void random_randomMethod(PikaObj *self, Args *args){ + pika_float res = random_random(self); + method_returnFloat(args, res); +} +method_typedef( + random_random, + "random", "" +); + +void random_randrangeMethod(PikaObj *self, Args *args){ + int start = args_getInt(args, "start"); + int stop = args_getInt(args, "stop"); + int step = args_getInt(args, "step"); + int res = random_randrange(self, start, stop, step); + method_returnInt(args, res); +} +method_typedef( + random_randrange, + "randrange", "start,stop,step" +); + +void random_seedMethod(PikaObj *self, Args *args){ + int a = args_getInt(args, "a"); + PikaObj* res = random_seed(self, a); + method_returnObj(args, res); +} +method_typedef( + random_seed, + "seed", "a" +); + +void random_uniformMethod(PikaObj *self, Args *args){ + pika_float a = args_getFloat(args, "a"); + pika_float b = args_getFloat(args, "b"); + pika_float res = random_uniform(self, a, b); + method_returnFloat(args, res); +} +method_typedef( + random_uniform, + "uniform", "a,b" +); + +class_def(random){ + __BEFORE_MOETHOD_DEF + method_def(random_random, 417623846), + method_def(random_randint, 896678645), + method_def(random___init__, 904762485), + method_def(random_uniform, 979024293), + method_def(random_randrange, 1535671287), + method_def(random_seed, 2090719782), +}; +class_inhert(random, TinyObj); + +PikaObj *New_random(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, random); + return self; +} +#endif + +#ifndef PIKA_MODULE_RE_DISABLE +void re_MatchMethod(PikaObj *self, Args *args){ + Arg* res = re_Match(self); + method_returnArg(args, res); +} +method_typedef( + re_Match, + "Match", "" +); + +void re_PatternMethod(PikaObj *self, Args *args){ + Arg* res = re_Pattern(self); + method_returnArg(args, res); +} +method_typedef( + re_Pattern, + "Pattern", "" +); + +void re___init__Method(PikaObj *self, Args *args){ + re___init__(self); +} +method_typedef( + re___init__, + "__init__", "" +); + +void re_compileMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_compile(self, pattern, flags); + method_returnObj(args, res); +} +method_typedef( + re_compile, + "compile", "pattern,*flags" +); + +void re_escapeMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* res = re_escape(self, pattern); + method_returnStr(args, res); +} +method_typedef( + re_escape, + "escape", "pattern" +); + +void re_findallMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_findall(self, pattern, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_findall, + "findall", "pattern,subject,*flags" +); + +void re_fullmatchMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_fullmatch(self, pattern, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_fullmatch, + "fullmatch", "pattern,subject,*flags" +); + +void re_matchMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_match(self, pattern, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_match, + "match", "pattern,subject,*flags" +); + +void re_searchMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_search(self, pattern, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_search, + "search", "pattern,subject,*flags" +); + +void re_splitMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* subject = args_getStr(args, "subject"); + PikaTuple* maxsplit__flags = args_getTuple(args, "maxsplit__flags"); + PikaObj* res = re_split(self, pattern, subject, maxsplit__flags); + method_returnObj(args, res); +} +method_typedef( + re_split, + "split", "pattern,subject,*maxsplit__flags" +); + +void re_subMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* repl = args_getStr(args, "repl"); + char* subjet = args_getStr(args, "subjet"); + PikaTuple* count__flags = args_getTuple(args, "count__flags"); + char* res = re_sub(self, pattern, repl, subjet, count__flags); + method_returnStr(args, res); +} +method_typedef( + re_sub, + "sub", "pattern,repl,subjet,*count__flags" +); + +void re_subnMethod(PikaObj *self, Args *args){ + char* pattern = args_getStr(args, "pattern"); + char* repl = args_getStr(args, "repl"); + char* subjet = args_getStr(args, "subjet"); + PikaTuple* count__flags = args_getTuple(args, "count__flags"); + PikaObj* res = re_subn(self, pattern, repl, subjet, count__flags); + method_returnObj(args, res); +} +method_typedef( + re_subn, + "subn", "pattern,repl,subjet,*count__flags" +); + +class_def(re){ + __BEFORE_MOETHOD_DEF + method_def(re_sub, 193506191), + constructor_def(re_Match, 229083730), + method_def(re_match, 267033202), + method_def(re_split, 274679281), + method_def(re_search, 461050587), + method_def(re_findall, 744522911), + method_def(re___init__, 904762485), + method_def(re_fullmatch, 1395800965), + method_def(re_compile, 1399152686), + method_def(re_escape, 2077295414), + method_def(re_subn, 2090737117), + constructor_def(re_Pattern, 2091610595), +}; +class_inhert(re, TinyObj); + +PikaObj *New_re(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, re); + return self; +} +#endif + +#ifndef PIKA_MODULE_RE_DISABLE +void re_Match___del__Method(PikaObj *self, Args *args){ + re_Match___del__(self); +} +method_typedef( + re_Match___del__, + "__del__", "" +); + +void re_Match___init__Method(PikaObj *self, Args *args){ + re_Match___init__(self); +} +method_typedef( + re_Match___init__, + "__init__", "" +); + +void re_Match_groupMethod(PikaObj *self, Args *args){ + PikaTuple* n = args_getTuple(args, "n"); + char* res = re_Match_group(self, n); + method_returnStr(args, res); +} +method_typedef( + re_Match_group, + "group", "*n" +); + +void re_Match_groupsMethod(PikaObj *self, Args *args){ + PikaObj* res = re_Match_groups(self); + method_returnObj(args, res); +} +method_typedef( + re_Match_groups, + "groups", "" +); + +void re_Match_spanMethod(PikaObj *self, Args *args){ + PikaTuple* group_n = args_getTuple(args, "group_n"); + PikaObj* res = re_Match_span(self, group_n); + method_returnObj(args, res); +} +method_typedef( + re_Match_span, + "span", "*group_n" +); + +class_def(re_Match){ + __BEFORE_MOETHOD_DEF + method_def(re_Match_groups, 7349669), + method_def(re_Match_group, 260523762), + method_def(re_Match___init__, 904762485), + method_def(re_Match___del__, 2038499702), + method_def(re_Match_span, 2090731639), +}; +class_inhert(re_Match, TinyObj); + +PikaObj *New_re_Match(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, re_Match); + return self; +} + +Arg *re_Match(PikaObj *self){ + return obj_newObjInPackage(New_re_Match); +} +#endif + +#ifndef PIKA_MODULE_RE_DISABLE +void re_Pattern___del__Method(PikaObj *self, Args *args){ + re_Pattern___del__(self); +} +method_typedef( + re_Pattern___del__, + "__del__", "" +); + +void re_Pattern___init__Method(PikaObj *self, Args *args){ + re_Pattern___init__(self); +} +method_typedef( + re_Pattern___init__, + "__init__", "" +); + +void re_Pattern_findallMethod(PikaObj *self, Args *args){ + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_Pattern_findall(self, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_findall, + "findall", "subject,*flags" +); + +void re_Pattern_fullmatchMethod(PikaObj *self, Args *args){ + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_Pattern_fullmatch(self, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_fullmatch, + "fullmatch", "subject,*flags" +); + +void re_Pattern_matchMethod(PikaObj *self, Args *args){ + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_Pattern_match(self, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_match, + "match", "subject,*flags" +); + +void re_Pattern_searchMethod(PikaObj *self, Args *args){ + char* subject = args_getStr(args, "subject"); + PikaTuple* flags = args_getTuple(args, "flags"); + PikaObj* res = re_Pattern_search(self, subject, flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_search, + "search", "subject,*flags" +); + +void re_Pattern_splitMethod(PikaObj *self, Args *args){ + char* subject = args_getStr(args, "subject"); + PikaTuple* maxsplit__flags = args_getTuple(args, "maxsplit__flags"); + PikaObj* res = re_Pattern_split(self, subject, maxsplit__flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_split, + "split", "subject,*maxsplit__flags" +); + +void re_Pattern_subMethod(PikaObj *self, Args *args){ + char* repl = args_getStr(args, "repl"); + char* subjet = args_getStr(args, "subjet"); + PikaTuple* count__flags = args_getTuple(args, "count__flags"); + char* res = re_Pattern_sub(self, repl, subjet, count__flags); + method_returnStr(args, res); +} +method_typedef( + re_Pattern_sub, + "sub", "repl,subjet,*count__flags" +); + +void re_Pattern_subnMethod(PikaObj *self, Args *args){ + char* repl = args_getStr(args, "repl"); + char* subjet = args_getStr(args, "subjet"); + PikaTuple* count__flags = args_getTuple(args, "count__flags"); + PikaObj* res = re_Pattern_subn(self, repl, subjet, count__flags); + method_returnObj(args, res); +} +method_typedef( + re_Pattern_subn, + "subn", "repl,subjet,*count__flags" +); + +class_def(re_Pattern){ + __BEFORE_MOETHOD_DEF + method_def(re_Pattern_sub, 193506191), + method_def(re_Pattern_match, 267033202), + method_def(re_Pattern_split, 274679281), + method_def(re_Pattern_search, 461050587), + method_def(re_Pattern_findall, 744522911), + method_def(re_Pattern___init__, 904762485), + method_def(re_Pattern_fullmatch, 1395800965), + method_def(re_Pattern___del__, 2038499702), + method_def(re_Pattern_subn, 2090737117), +}; +class_inhert(re_Pattern, TinyObj); + +PikaObj *New_re_Pattern(Args *args){ + PikaObj *self = New_TinyObj(args); + obj_setClass(self, re_Pattern); + return self; +} + +Arg *re_Pattern(PikaObj *self){ + return obj_newObjInPackage(New_re_Pattern); +} +#endif + diff --git a/examples/pikapython/pikapython/pikascript-api/_modbus.h b/examples/pikapython/pikapython/pikascript-api/_modbus.h new file mode 100644 index 00000000..a76a6eab --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/_modbus.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef ___modbus__H +#define ___modbus__H +#include +#include +#include "PikaObj.h" + +PikaObj *New__modbus(Args *args); + +Arg* _modbus__ModBus(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/_modbus__ModBus.h b/examples/pikapython/pikapython/pikascript-api/_modbus__ModBus.h new file mode 100644 index 00000000..e041aa98 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/_modbus__ModBus.h @@ -0,0 +1,48 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef ___modbus__ModBus__H +#define ___modbus__ModBus__H +#include +#include +#include "PikaObj.h" + +PikaObj *New__modbus__ModBus(Args *args); + +void _modbus__ModBus___init__rtu(PikaObj *self, int sendBuffSize, int readBuffSize); +void _modbus__ModBus___init__tcp(PikaObj *self, int sendBuffSize, int readBuffSize); +int _modbus__ModBus_deserializeMaskWriteRegister(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_deserializeReadBits(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_deserializeReadInputBits(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_deserializeReadInputRegisters(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_deserializeReadRegisters(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_deserializeReportSlaveId(PikaObj *self, int msgLength, int maxDest); +Arg* _modbus__ModBus_deserializeWriteAndReadRegisters(PikaObj *self, int msgLength); +int _modbus__ModBus_deserializeWriteBit(PikaObj *self, int msgLength); +int _modbus__ModBus_deserializeWriteBits(PikaObj *self, int msgLength); +int _modbus__ModBus_deserializeWriteRegister(PikaObj *self, int msgLength); +int _modbus__ModBus_deserializeWriteRegisters(PikaObj *self, int msgLength); +Arg* _modbus__ModBus_getReadBuff(PikaObj *self); +Arg* _modbus__ModBus_getSendBuff(PikaObj *self); +int _modbus__ModBus_serializeMaskWriteRegister(PikaObj *self, int addr, int andMask, int orMask); +int _modbus__ModBus_serializeReadBits(PikaObj *self, int addr, int nb); +int _modbus__ModBus_serializeReadInputBits(PikaObj *self, int addr, int nb); +int _modbus__ModBus_serializeReadInputRegisters(PikaObj *self, int addr, int nb); +int _modbus__ModBus_serializeReadRegisters(PikaObj *self, int addr, int nb); +int _modbus__ModBus_serializeReportSlaveId(PikaObj *self); +int _modbus__ModBus_serializeWriteAndReadRegisters(PikaObj *self, int writeAddr, int writeNb, uint8_t* src, int readAddr, int readNb); +int _modbus__ModBus_serializeWriteBit(PikaObj *self, int addr, int status); +int _modbus__ModBus_serializeWriteBits(PikaObj *self, int addr, int nb, uint8_t* src); +int _modbus__ModBus_serializeWriteRegister(PikaObj *self, int addr, int value); +int _modbus__ModBus_serializeWriteRegisters(PikaObj *self, int addr, int nb, uint8_t* src); +void _modbus__ModBus_setSlave(PikaObj *self, int slave); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/_thread.h b/examples/pikapython/pikapython/pikascript-api/_thread.h new file mode 100644 index 00000000..982aa704 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/_thread.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef ___thread__H +#define ___thread__H +#include +#include +#include "PikaObj.h" + +PikaObj *New__thread(Args *args); + +void _thread_start_new_thread(PikaObj *self, Arg* function, Arg* args_); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/_time.h b/examples/pikapython/pikapython/pikascript-api/_time.h new file mode 100644 index 00000000..4ea7bbd6 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/_time.h @@ -0,0 +1,32 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef ___time__H +#define ___time__H +#include +#include +#include "PikaObj.h" + +PikaObj *New__time(Args *args); + +void _time___init__(PikaObj *self); +void _time_asctime(PikaObj *self); +void _time_ctime(PikaObj *self, pika_float unix_time); +void _time_gmtime(PikaObj *self, pika_float unix_time); +void _time_localtime(PikaObj *self, pika_float unix_time); +int _time_mktime(PikaObj *self); +void _time_platformGetTick(PikaObj *self); +void _time_sleep_ms(PikaObj *self, int ms); +void _time_sleep_s(PikaObj *self, int s); +pika_float _time_time(PikaObj *self); +int _time_time_ns(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/binascii.h b/examples/pikapython/pikapython/pikascript-api/binascii.h new file mode 100644 index 00000000..0ad527cd --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/binascii.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __binascii__H +#define __binascii__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_binascii(Args *args); + +Arg* binascii_a2b_hex(PikaObj *self, char* val); +Arg* binascii_b2a_hex(PikaObj *self, Arg* val); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/configparser.py.o b/examples/pikapython/pikapython/pikascript-api/configparser.py.o new file mode 100644 index 00000000..0f00c82c Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/configparser.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/example.py.o b/examples/pikapython/pikapython/pikascript-api/example.py.o new file mode 100644 index 00000000..b952d0fd Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/example.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/json.py.o b/examples/pikapython/pikapython/pikascript-api/json.py.o new file mode 100644 index 00000000..c1f2cec4 Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/json.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/machine.py.o b/examples/pikapython/pikapython/pikascript-api/machine.py.o new file mode 100644 index 00000000..5153014c Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/machine.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/main.py.o b/examples/pikapython/pikapython/pikascript-api/main.py.o new file mode 100644 index 00000000..b2fa042d Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/main.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/modbus.py.o b/examples/pikapython/pikapython/pikascript-api/modbus.py.o new file mode 100644 index 00000000..8f6f8e9a Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/modbus.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/pikaModules.py.a b/examples/pikapython/pikapython/pikascript-api/pikaModules.py.a new file mode 100644 index 00000000..42f10639 Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/pikaModules.py.a differ diff --git a/examples/pikapython/pikapython/pikascript-api/pikaScript.c b/examples/pikapython/pikapython/pikascript-api/pikaScript.c new file mode 100644 index 00000000..7c6a2cd8 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pikaScript.c @@ -0,0 +1,65 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#include "PikaMain.h" +#include +#include + +volatile PikaObj *__pikaMain; +PikaObj *pikaScriptInit(void){ + __platform_printf("======[pikascript packages installed]======\r\n"); + pks_printVersion(); + __platform_printf("PikaMath==v0.2.1\r\n"); + __platform_printf("PikaStdDevice==v2.3.6\r\n"); + __platform_printf("PikaStdLib==latest\r\n"); + __platform_printf("_thread==v0.0.3\r\n"); + __platform_printf("binascii==v0.0.1\r\n"); + __platform_printf("configparser==v0.2.1\r\n"); + __platform_printf("json==v0.1.1\r\n"); + __platform_printf("modbus==v0.0.4\r\n"); + __platform_printf("pika_cjson==v1.2.2\r\n"); + __platform_printf("pika_libc==v1.0.1\r\n"); + __platform_printf("pika_lvgl==v0.4.4\r\n"); + __platform_printf("random==v0.1.1\r\n"); + __platform_printf("re==v0.1.1\r\n"); + __platform_printf("time==v0.1.3\r\n"); + __platform_printf("unittest==v0.1.2\r\n"); + __platform_printf("===========================================\r\n"); + PikaObj* pikaMain = newRootObj("pikaMain", New_PikaMain); + __pikaMain = pikaMain; + extern unsigned char pikaModules_py_a[]; + obj_linkLibrary(pikaMain, pikaModules_py_a); +#if PIKA_INIT_STRING_ENABLE + obj_run(pikaMain, + "import PikaStdLib\n" + "import random\n" + "import PikaStdData\n" + "import configparser\n" + "import pika_cjson\n" + "import PikaMath\n" + "import unittest\n" + "import re\n" + "import binascii\n" + "import modbus\n" + "import time\n" + "import pika_lvgl\n" + "import _thread\n" + "import machine\n" + "import example\n" + "import json\n" + "print('hello PikaPython!')\n" + "\n"); +#else + obj_runModule((PikaObj*)pikaMain, "main"); +#endif + return pikaMain; +} + diff --git a/examples/pikapython/pikapython/pikascript-api/pikaScript.h b/examples/pikapython/pikapython/pikascript-api/pikaScript.h new file mode 100644 index 00000000..3b5c169f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pikaScript.h @@ -0,0 +1,13 @@ +/* ******************************** */ +/* Warning! Don't modify this file! */ +/* ******************************** */ +#ifndef __pikaScript__H +#define __pikaScript__H +#include +#include +#include "PikaObj.h" +#include "PikaMain.h" + +PikaObj * pikaScriptInit(void); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson.h new file mode 100644 index 00000000..d9320b40 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson.h @@ -0,0 +1,35 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson__H +#define __pika_cjson__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson(Args *args); + +Arg* pika_cjson_Array(PikaObj *self); +Arg* pika_cjson_ArrayReference(PikaObj *self); +Arg* pika_cjson_Bool(PikaObj *self); +Arg* pika_cjson_False_(PikaObj *self); +Arg* pika_cjson_Null(PikaObj *self); +Arg* pika_cjson_Number(PikaObj *self); +Arg* pika_cjson_Object(PikaObj *self); +Arg* pika_cjson_ObjectReference(PikaObj *self); +PikaObj* pika_cjson_Parse(PikaObj *self, char* value); +Arg* pika_cjson_Raw(PikaObj *self); +Arg* pika_cjson_String(PikaObj *self); +Arg* pika_cjson_StringReference(PikaObj *self); +Arg* pika_cjson_True_(PikaObj *self); +Arg* pika_cjson_cJSON(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Array.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Array.h new file mode 100644 index 00000000..d25d1549 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Array.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Array__H +#define __pika_cjson_Array__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Array(Args *args); + +void pika_cjson_Array___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_ArrayReference.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_ArrayReference.h new file mode 100644 index 00000000..7dda3cea --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_ArrayReference.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_ArrayReference__H +#define __pika_cjson_ArrayReference__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_ArrayReference(Args *args); + +void pika_cjson_ArrayReference___init__(PikaObj *self, PikaObj* child); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Bool.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Bool.h new file mode 100644 index 00000000..21d915d3 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Bool.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Bool__H +#define __pika_cjson_Bool__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Bool(Args *args); + +void pika_cjson_Bool___init__(PikaObj *self, int bolean); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_False_.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_False_.h new file mode 100644 index 00000000..42428bd1 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_False_.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_False___H +#define __pika_cjson_False___H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_False_(Args *args); + +void pika_cjson_False____init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Null.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Null.h new file mode 100644 index 00000000..4138b8cb --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Null.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Null__H +#define __pika_cjson_Null__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Null(Args *args); + +void pika_cjson_Null___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Number.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Number.h new file mode 100644 index 00000000..72267800 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Number.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Number__H +#define __pika_cjson_Number__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Number(Args *args); + +void pika_cjson_Number___init__(PikaObj *self, pika_float num); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Object.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Object.h new file mode 100644 index 00000000..a1ef8d2e --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Object.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Object__H +#define __pika_cjson_Object__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Object(Args *args); + +void pika_cjson_Object___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_ObjectReference.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_ObjectReference.h new file mode 100644 index 00000000..4c0a19b2 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_ObjectReference.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_ObjectReference__H +#define __pika_cjson_ObjectReference__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_ObjectReference(Args *args); + +void pika_cjson_ObjectReference___init__(PikaObj *self, PikaObj* child); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_Raw.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Raw.h new file mode 100644 index 00000000..46930abf --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_Raw.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_Raw__H +#define __pika_cjson_Raw__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_Raw(Args *args); + +void pika_cjson_Raw___init__(PikaObj *self, char* raw); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_String.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_String.h new file mode 100644 index 00000000..199eb6d7 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_String.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_String__H +#define __pika_cjson_String__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_String(Args *args); + +void pika_cjson_String___init__(PikaObj *self, char* string); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_StringReference.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_StringReference.h new file mode 100644 index 00000000..8f81913b --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_StringReference.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_StringReference__H +#define __pika_cjson_StringReference__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_StringReference(Args *args); + +void pika_cjson_StringReference___init__(PikaObj *self, char* string); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_True_.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_True_.h new file mode 100644 index 00000000..67e60c31 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_True_.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_True___H +#define __pika_cjson_True___H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_True_(Args *args); + +void pika_cjson_True____init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_cjson_cJSON.h b/examples/pikapython/pikapython/pikascript-api/pika_cjson_cJSON.h new file mode 100644 index 00000000..919c4e26 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_cjson_cJSON.h @@ -0,0 +1,48 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_cjson_cJSON__H +#define __pika_cjson_cJSON__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_cjson_cJSON(Args *args); + +void pika_cjson_cJSON___del__(PikaObj *self); +void pika_cjson_cJSON___init__(PikaObj *self); +void pika_cjson_cJSON_addItemToArray(PikaObj *self, PikaObj* item); +void pika_cjson_cJSON_addItemToObject(PikaObj *self, char* string, PikaObj* item); +PikaObj* pika_cjson_cJSON_getArrayItem(PikaObj *self, int index); +int pika_cjson_cJSON_getArraySize(PikaObj *self); +PikaObj* pika_cjson_cJSON_getChild(PikaObj *self); +PikaObj* pika_cjson_cJSON_getNext(PikaObj *self); +PikaObj* pika_cjson_cJSON_getObjectItem(PikaObj *self, char* string); +PikaObj* pika_cjson_cJSON_getPrev(PikaObj *self); +char* pika_cjson_cJSON_getString(PikaObj *self); +int pika_cjson_cJSON_getType(PikaObj *self); +Arg* pika_cjson_cJSON_getValue(PikaObj *self); +pika_float pika_cjson_cJSON_getValueDouble(PikaObj *self); +int pika_cjson_cJSON_getValueInt(PikaObj *self); +char* pika_cjson_cJSON_getValueString(PikaObj *self); +int pika_cjson_cJSON_isArray(PikaObj *self); +int pika_cjson_cJSON_isBool(PikaObj *self); +int pika_cjson_cJSON_isFalse(PikaObj *self); +int pika_cjson_cJSON_isInvalid(PikaObj *self); +int pika_cjson_cJSON_isNull(PikaObj *self); +int pika_cjson_cJSON_isNumber(PikaObj *self); +int pika_cjson_cJSON_isObject(PikaObj *self); +int pika_cjson_cJSON_isRaw(PikaObj *self); +int pika_cjson_cJSON_isString(PikaObj *self); +int pika_cjson_cJSON_isTrue(PikaObj *self); +char* pika_cjson_cJSON_print(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_libc.h b/examples/pikapython/pikapython/pikascript-api/pika_libc.h new file mode 100644 index 00000000..be6f7c16 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_libc.h @@ -0,0 +1,21 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_libc__H +#define __pika_libc__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_libc(Args *args); + + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl.h new file mode 100644 index 00000000..8ed020a7 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl.h @@ -0,0 +1,63 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl__H +#define __pika_lvgl__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl(Args *args); + +Arg* pika_lvgl_ALIGN(PikaObj *self); +Arg* pika_lvgl_ANIM(PikaObj *self); +Arg* pika_lvgl_EVENT(PikaObj *self); +Arg* pika_lvgl_FLEX_ALIGN(PikaObj *self); +Arg* pika_lvgl_FLEX_FLOW(PikaObj *self); +Arg* pika_lvgl_LAYOUT_FLEX(PikaObj *self); +Arg* pika_lvgl_OPA(PikaObj *self); +Arg* pika_lvgl_PALETTE(PikaObj *self); +Arg* pika_lvgl_SIZE(PikaObj *self); +Arg* pika_lvgl_STATE(PikaObj *self); +Arg* pika_lvgl_TEXT_DECOR(PikaObj *self); +void pika_lvgl___del__(PikaObj *self); +void pika_lvgl___init__(PikaObj *self); +Arg* pika_lvgl_arc(PikaObj *self); +Arg* pika_lvgl_bar(PikaObj *self); +Arg* pika_lvgl_btn(PikaObj *self); +Arg* pika_lvgl_checkbox(PikaObj *self); +Arg* pika_lvgl_dropdown(PikaObj *self); +Arg* pika_lvgl_flag_t(PikaObj *self); +Arg* pika_lvgl_img(PikaObj *self); +Arg* pika_lvgl_img_dsc_t(PikaObj *self); +PikaObj* pika_lvgl_indev_get_act(PikaObj *self); +Arg* pika_lvgl_indev_t(PikaObj *self); +Arg* pika_lvgl_label(PikaObj *self); +PikaObj* pika_lvgl_lv_color_hex(PikaObj *self, int64_t hex); +Arg* pika_lvgl_lv_color_t(PikaObj *self); +Arg* pika_lvgl_lv_event(PikaObj *self); +Arg* pika_lvgl_lv_obj(PikaObj *self); +Arg* pika_lvgl_lv_timer_t(PikaObj *self); +Arg* pika_lvgl_obj(PikaObj *self); +PikaObj* pika_lvgl_palette_lighten(PikaObj *self, int p, int lvl); +PikaObj* pika_lvgl_palette_main(PikaObj *self, int p); +int pika_lvgl_pct(PikaObj *self, int x); +Arg* pika_lvgl_point_t(PikaObj *self); +Arg* pika_lvgl_roller(PikaObj *self); +PikaObj* pika_lvgl_scr_act(PikaObj *self); +Arg* pika_lvgl_slider(PikaObj *self); +Arg* pika_lvgl_style_t(PikaObj *self); +Arg* pika_lvgl_switch(PikaObj *self); +Arg* pika_lvgl_table(PikaObj *self); +Arg* pika_lvgl_textarea(PikaObj *self); +PikaObj* pika_lvgl_timer_create_basic(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ALIGN.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ALIGN.h new file mode 100644 index 00000000..66466dc5 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ALIGN.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_ALIGN__H +#define __pika_lvgl_ALIGN__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_ALIGN(Args *args); + +void pika_lvgl_ALIGN___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ANIM.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ANIM.h new file mode 100644 index 00000000..505a30f3 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_ANIM.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_ANIM__H +#define __pika_lvgl_ANIM__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_ANIM(Args *args); + +void pika_lvgl_ANIM___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_EVENT.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_EVENT.h new file mode 100644 index 00000000..1526e4c8 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_EVENT.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_EVENT__H +#define __pika_lvgl_EVENT__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_EVENT(Args *args); + +void pika_lvgl_EVENT___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_ALIGN.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_ALIGN.h new file mode 100644 index 00000000..1f95cf4d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_ALIGN.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_FLEX_ALIGN__H +#define __pika_lvgl_FLEX_ALIGN__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_FLEX_ALIGN(Args *args); + +void pika_lvgl_FLEX_ALIGN___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_FLOW.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_FLOW.h new file mode 100644 index 00000000..d9b254ad --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_FLEX_FLOW.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_FLEX_FLOW__H +#define __pika_lvgl_FLEX_FLOW__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_FLEX_FLOW(Args *args); + +void pika_lvgl_FLEX_FLOW___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_LAYOUT_FLEX.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_LAYOUT_FLEX.h new file mode 100644 index 00000000..2836c9df --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_LAYOUT_FLEX.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_LAYOUT_FLEX__H +#define __pika_lvgl_LAYOUT_FLEX__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_LAYOUT_FLEX(Args *args); + +void pika_lvgl_LAYOUT_FLEX___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_OPA.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_OPA.h new file mode 100644 index 00000000..c6c8279f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_OPA.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_OPA__H +#define __pika_lvgl_OPA__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_OPA(Args *args); + +void pika_lvgl_OPA___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_PALETTE.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_PALETTE.h new file mode 100644 index 00000000..8c129578 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_PALETTE.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_PALETTE__H +#define __pika_lvgl_PALETTE__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_PALETTE(Args *args); + +void pika_lvgl_PALETTE___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_SIZE.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_SIZE.h new file mode 100644 index 00000000..92edb25f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_SIZE.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_SIZE__H +#define __pika_lvgl_SIZE__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_SIZE(Args *args); + +void pika_lvgl_SIZE___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_STATE.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_STATE.h new file mode 100644 index 00000000..f00dd2a4 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_STATE.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_STATE__H +#define __pika_lvgl_STATE__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_STATE(Args *args); + +void pika_lvgl_STATE___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_TEXT_DECOR.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_TEXT_DECOR.h new file mode 100644 index 00000000..aba9fd3d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_TEXT_DECOR.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_TEXT_DECOR__H +#define __pika_lvgl_TEXT_DECOR__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_TEXT_DECOR(Args *args); + +void pika_lvgl_TEXT_DECOR___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_arc.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_arc.h new file mode 100644 index 00000000..b7cb6db9 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_arc.h @@ -0,0 +1,41 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_arc__H +#define __pika_lvgl_arc__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_arc(Args *args); + +void pika_lvgl_arc___init__(PikaObj *self, PikaObj* parent); +int pika_lvgl_arc_get_angle_end(PikaObj *self); +int pika_lvgl_arc_get_angle_start(PikaObj *self); +int pika_lvgl_arc_get_bg_angle_end(PikaObj *self); +int pika_lvgl_arc_get_bg_angle_start(PikaObj *self); +int pika_lvgl_arc_get_max_value(PikaObj *self); +int pika_lvgl_arc_get_min_value(PikaObj *self); +int pika_lvgl_arc_get_mode(PikaObj *self); +int pika_lvgl_arc_get_value(PikaObj *self); +void pika_lvgl_arc_set_angles(PikaObj *self, int start, int end); +void pika_lvgl_arc_set_bg_angles(PikaObj *self, int start, int end); +void pika_lvgl_arc_set_bg_end_angle(PikaObj *self, int angle); +void pika_lvgl_arc_set_bg_start_angle(PikaObj *self, int start); +void pika_lvgl_arc_set_change_rate(PikaObj *self, int rate); +void pika_lvgl_arc_set_end_angle(PikaObj *self, int angle); +void pika_lvgl_arc_set_mode(PikaObj *self, int mode); +void pika_lvgl_arc_set_range(PikaObj *self, int min, int max); +void pika_lvgl_arc_set_rotation(PikaObj *self, int rotation); +void pika_lvgl_arc_set_start_angle(PikaObj *self, int start); +void pika_lvgl_arc_set_value(PikaObj *self, int value); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_bar.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_bar.h new file mode 100644 index 00000000..6c0d88c0 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_bar.h @@ -0,0 +1,31 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_bar__H +#define __pika_lvgl_bar__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_bar(Args *args); + +void pika_lvgl_bar___init__(PikaObj *self, PikaObj* parent); +int pika_lvgl_bar_get_max_value(PikaObj *self); +int pika_lvgl_bar_get_min_value(PikaObj *self); +int pika_lvgl_bar_get_mode(PikaObj *self); +int pika_lvgl_bar_get_start_value(PikaObj *self); +int pika_lvgl_bar_get_value(PikaObj *self); +void pika_lvgl_bar_set_mode(PikaObj *self, int mode); +void pika_lvgl_bar_set_range(PikaObj *self, int min, int max); +void pika_lvgl_bar_set_start_value(PikaObj *self, int start_value, int anim); +void pika_lvgl_bar_set_value(PikaObj *self, int value, int anim); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_btn.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_btn.h new file mode 100644 index 00000000..55b5736d --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_btn.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_btn__H +#define __pika_lvgl_btn__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_btn(Args *args); + +void pika_lvgl_btn___init__(PikaObj *self, PikaObj* parent); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_checkbox.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_checkbox.h new file mode 100644 index 00000000..08d86e64 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_checkbox.h @@ -0,0 +1,25 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_checkbox__H +#define __pika_lvgl_checkbox__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_checkbox(Args *args); + +void pika_lvgl_checkbox___init__(PikaObj *self, PikaObj* parent); +char* pika_lvgl_checkbox_get_text(PikaObj *self); +void pika_lvgl_checkbox_set_text(PikaObj *self, char* txt); +void pika_lvgl_checkbox_set_text_static(PikaObj *self, char* txt); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_dropdown.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_dropdown.h new file mode 100644 index 00000000..a9f2284c --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_dropdown.h @@ -0,0 +1,42 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_dropdown__H +#define __pika_lvgl_dropdown__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_dropdown(Args *args); + +void pika_lvgl_dropdown___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_dropdown_add_option(PikaObj *self, char* option, int pos); +void pika_lvgl_dropdown_clear_options(PikaObj *self); +void pika_lvgl_dropdown_close(PikaObj *self); +int pika_lvgl_dropdown_get_dir(PikaObj *self); +int pika_lvgl_dropdown_get_option_cnt(PikaObj *self); +int pika_lvgl_dropdown_get_option_index(PikaObj *self, char* option); +char* pika_lvgl_dropdown_get_options(PikaObj *self); +int pika_lvgl_dropdown_get_selected(PikaObj *self); +int pika_lvgl_dropdown_get_selected_highlight(PikaObj *self); +char* pika_lvgl_dropdown_get_selected_str(PikaObj *self); +char* pika_lvgl_dropdown_get_symbol(PikaObj *self); +char* pika_lvgl_dropdown_get_text(PikaObj *self); +int pika_lvgl_dropdown_is_open(PikaObj *self); +void pika_lvgl_dropdown_open(PikaObj *self); +void pika_lvgl_dropdown_set_dir(PikaObj *self, int dir); +void pika_lvgl_dropdown_set_options(PikaObj *self, char* options); +void pika_lvgl_dropdown_set_selected(PikaObj *self, int sel_opt); +void pika_lvgl_dropdown_set_selected_hightlight(PikaObj *self, int en); +void pika_lvgl_dropdown_set_symbol(PikaObj *self, char* symbol); +void pika_lvgl_dropdown_set_text(PikaObj *self, char* txt); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_flag_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_flag_t.h new file mode 100644 index 00000000..552286ad --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_flag_t.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_flag_t__H +#define __pika_lvgl_flag_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_flag_t(Args *args); + +void pika_lvgl_flag_t___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img.h new file mode 100644 index 00000000..d6f15afd --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img.h @@ -0,0 +1,37 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_img__H +#define __pika_lvgl_img__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_img(Args *args); + +void pika_lvgl_img___init__(PikaObj *self, PikaObj* parent); +int pika_lvgl_img_get_angle(PikaObj *self); +int pika_lvgl_img_get_antialias(PikaObj *self); +int pika_lvgl_img_get_offset_x(PikaObj *self); +int pika_lvgl_img_get_offset_y(PikaObj *self); +int pika_lvgl_img_get_size_mode(PikaObj *self); +PikaObj* pika_lvgl_img_get_src(PikaObj *self); +int pika_lvgl_img_get_zoom(PikaObj *self); +void pika_lvgl_img_set_angle(PikaObj *self, int angle); +void pika_lvgl_img_set_antialias(PikaObj *self, int antialias); +void pika_lvgl_img_set_offset_x(PikaObj *self, int x); +void pika_lvgl_img_set_offset_y(PikaObj *self, int y); +void pika_lvgl_img_set_pivot(PikaObj *self, int x, int y); +void pika_lvgl_img_set_size_mode(PikaObj *self, int mode); +void pika_lvgl_img_set_src(PikaObj *self, PikaObj* src); +void pika_lvgl_img_set_zoom(PikaObj *self, int zoom); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img_dsc_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img_dsc_t.h new file mode 100644 index 00000000..a5a6474c --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_img_dsc_t.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_img_dsc_t__H +#define __pika_lvgl_img_dsc_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_img_dsc_t(Args *args); + +void pika_lvgl_img_dsc_t___init__(PikaObj *self, PikaObj* dsc_dict); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_indev_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_indev_t.h new file mode 100644 index 00000000..6d4bf4b5 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_indev_t.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_indev_t__H +#define __pika_lvgl_indev_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_indev_t(Args *args); + +void pika_lvgl_indev_t_get_vect(PikaObj *self, PikaObj* point); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_label.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_label.h new file mode 100644 index 00000000..fc3b8440 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_label.h @@ -0,0 +1,26 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_label__H +#define __pika_lvgl_label__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_label(Args *args); + +void pika_lvgl_label___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_label_set_long_mode(PikaObj *self, int mode); +void pika_lvgl_label_set_recolor(PikaObj *self, int en); +void pika_lvgl_label_set_style_text_align(PikaObj *self, int value, int selector); +void pika_lvgl_label_set_text(PikaObj *self, char* txt); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_color_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_color_t.h new file mode 100644 index 00000000..5897c024 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_color_t.h @@ -0,0 +1,21 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_lv_color_t__H +#define __pika_lvgl_lv_color_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_lv_color_t(Args *args); + + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_event.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_event.h new file mode 100644 index 00000000..a3eb43d2 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_event.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_lv_event__H +#define __pika_lvgl_lv_event__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_lv_event(Args *args); + +int pika_lvgl_lv_event_get_code(PikaObj *self); +PikaObj* pika_lvgl_lv_event_get_target(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_obj.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_obj.h new file mode 100644 index 00000000..43c81fbd --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_obj.h @@ -0,0 +1,72 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_lv_obj__H +#define __pika_lvgl_lv_obj__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_lv_obj(Args *args); + +void pika_lvgl_lv_obj___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_lv_obj_add_event_cb(PikaObj *self, Arg* event_cb, int filter, void* user_data); +void pika_lvgl_lv_obj_add_flag(PikaObj *self, int flag); +void pika_lvgl_lv_obj_add_state(PikaObj *self, int state); +void pika_lvgl_lv_obj_add_style(PikaObj *self, PikaObj* style, int selector); +void pika_lvgl_lv_obj_align(PikaObj *self, int align, int x_ofs, int y_ofs); +void pika_lvgl_lv_obj_align_to(PikaObj *self, PikaObj* base, int align, int x_ofs, int y_ofs); +void pika_lvgl_lv_obj_center(PikaObj *self); +void pika_lvgl_lv_obj_clean(PikaObj *self); +void pika_lvgl_lv_obj_clear_flag(PikaObj *self, int flag); +void pika_lvgl_lv_obj_del_(PikaObj *self); +int pika_lvgl_lv_obj_get_content_height(PikaObj *self); +int pika_lvgl_lv_obj_get_content_width(PikaObj *self); +int pika_lvgl_lv_obj_get_height(PikaObj *self); +char* pika_lvgl_lv_obj_get_id(PikaObj *self); +int pika_lvgl_lv_obj_get_self_height(PikaObj *self); +int pika_lvgl_lv_obj_get_self_width(PikaObj *self); +int pika_lvgl_lv_obj_get_width(PikaObj *self); +int pika_lvgl_lv_obj_get_x(PikaObj *self); +int pika_lvgl_lv_obj_get_x2(PikaObj *self); +int pika_lvgl_lv_obj_get_x_aligned(PikaObj *self); +int pika_lvgl_lv_obj_get_y(PikaObj *self); +int pika_lvgl_lv_obj_get_y2(PikaObj *self); +int pika_lvgl_lv_obj_get_y_aligned(PikaObj *self); +int pika_lvgl_lv_obj_hit_test(PikaObj *self, PikaObj* point); +void pika_lvgl_lv_obj_invalidate(PikaObj *self); +int pika_lvgl_lv_obj_is_layout_positioned(PikaObj *self); +int pika_lvgl_lv_obj_is_visible(PikaObj *self); +void pika_lvgl_lv_obj_mark_layout_as_dirty(PikaObj *self); +void pika_lvgl_lv_obj_move_children_by(PikaObj *self, int x_diff, int y_diff, int ignore_floating); +void pika_lvgl_lv_obj_move_to(PikaObj *self, int x, int y); +void pika_lvgl_lv_obj_refr_pos(PikaObj *self); +int pika_lvgl_lv_obj_refr_size(PikaObj *self); +int pika_lvgl_lv_obj_refresh_self_size(PikaObj *self); +void pika_lvgl_lv_obj_set_align(PikaObj *self, int align); +void pika_lvgl_lv_obj_set_content_height(PikaObj *self, int h); +void pika_lvgl_lv_obj_set_content_width(PikaObj *self, int w); +void pika_lvgl_lv_obj_set_ext_click_area(PikaObj *self, int size); +void pika_lvgl_lv_obj_set_flex_align(PikaObj *self, int main_place, int cross_place, int align); +void pika_lvgl_lv_obj_set_flex_flow(PikaObj *self, int flow); +void pika_lvgl_lv_obj_set_flex_grow(PikaObj *self, int value); +void pika_lvgl_lv_obj_set_height(PikaObj *self, int h); +void pika_lvgl_lv_obj_set_id(PikaObj *self, char* id); +void pika_lvgl_lv_obj_set_layout(PikaObj *self, int layout); +void pika_lvgl_lv_obj_set_pos(PikaObj *self, int x, int y); +void pika_lvgl_lv_obj_set_size(PikaObj *self, int w, int h); +void pika_lvgl_lv_obj_set_width(PikaObj *self, int w); +void pika_lvgl_lv_obj_set_x(PikaObj *self, int x); +void pika_lvgl_lv_obj_set_y(PikaObj *self, int y); +void pika_lvgl_lv_obj_transform_point(PikaObj *self, PikaObj* p, int recursive, int inv); +void pika_lvgl_lv_obj_update_layout(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_timer_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_timer_t.h new file mode 100644 index 00000000..9a11ee7f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_lv_timer_t.h @@ -0,0 +1,24 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_lv_timer_t__H +#define __pika_lvgl_lv_timer_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_lv_timer_t(Args *args); + +void pika_lvgl_lv_timer_t__del(PikaObj *self); +void pika_lvgl_lv_timer_t_set_cb(PikaObj *self, Arg* cb); +void pika_lvgl_lv_timer_t_set_period(PikaObj *self, int period); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_obj.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_obj.h new file mode 100644 index 00000000..24dc2581 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_obj.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_obj__H +#define __pika_lvgl_obj__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_obj(Args *args); + +void pika_lvgl_obj___init__(PikaObj *self, PikaTuple* parent); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_point_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_point_t.h new file mode 100644 index 00000000..3943c8f4 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_point_t.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_point_t__H +#define __pika_lvgl_point_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_point_t(Args *args); + +void pika_lvgl_point_t___init__(PikaObj *self); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_roller.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_roller.h new file mode 100644 index 00000000..d8756629 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_roller.h @@ -0,0 +1,24 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_roller__H +#define __pika_lvgl_roller__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_roller(Args *args); + +void pika_lvgl_roller___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_roller_set_options(PikaObj *self, char* options, int mode); +void pika_lvgl_roller_set_visible_row_count(PikaObj *self, int row_cnt); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_slider.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_slider.h new file mode 100644 index 00000000..f338aff6 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_slider.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_slider__H +#define __pika_lvgl_slider__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_slider(Args *args); + +void pika_lvgl_slider___init__(PikaObj *self, PikaObj* parent); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_style_t.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_style_t.h new file mode 100644 index 00000000..cbcae6ae --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_style_t.h @@ -0,0 +1,118 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_style_t__H +#define __pika_lvgl_style_t__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_style_t(Args *args); + +void pika_lvgl_style_t___init__(PikaObj *self); +int pika_lvgl_style_t_get_num_custom_props(PikaObj *self); +void pika_lvgl_style_t_init(PikaObj *self); +int pika_lvgl_style_t_is_empty(PikaObj *self); +int pika_lvgl_style_t_prop_has_flag(PikaObj *self, int prop, int flag); +int pika_lvgl_style_t_register_prop(PikaObj *self, int flag); +int pika_lvgl_style_t_remove_prop(PikaObj *self, int prop); +void pika_lvgl_style_t_reset(PikaObj *self); +void pika_lvgl_style_t_set_align(PikaObj *self, int value); +void pika_lvgl_style_t_set_anim_speed(PikaObj *self, int value); +void pika_lvgl_style_t_set_anim_time(PikaObj *self, int value); +void pika_lvgl_style_t_set_arc_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_arc_img_src(PikaObj *self, uint8_t* value); +void pika_lvgl_style_t_set_arc_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_arc_rounded(PikaObj *self, int value); +void pika_lvgl_style_t_set_arc_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_base_dir(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_bg_dither_mode(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_grad_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_bg_grad_dir(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_grad_stop(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_img_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_img_recolor(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_bg_img_recolor_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_img_src(PikaObj *self, uint8_t* value); +void pika_lvgl_style_t_set_bg_img_tiled(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_main_stop(PikaObj *self, int value); +void pika_lvgl_style_t_set_bg_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_blend_mode(PikaObj *self, int value); +void pika_lvgl_style_t_set_border_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_border_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_border_post(PikaObj *self, int value); +void pika_lvgl_style_t_set_border_side(PikaObj *self, int value); +void pika_lvgl_style_t_set_border_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_clip_corner(PikaObj *self, int value); +void pika_lvgl_style_t_set_color_filter_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_flex_cross_place(PikaObj *self, int value); +void pika_lvgl_style_t_set_flex_flow(PikaObj *self, int value); +void pika_lvgl_style_t_set_flex_grow(PikaObj *self, int value); +void pika_lvgl_style_t_set_flex_main_place(PikaObj *self, int value); +void pika_lvgl_style_t_set_flex_track_place(PikaObj *self, int value); +void pika_lvgl_style_t_set_height(PikaObj *self, int value); +void pika_lvgl_style_t_set_img_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_img_recolor(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_img_recolor_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_layout(PikaObj *self, int value); +void pika_lvgl_style_t_set_line_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_line_dash_gap(PikaObj *self, int value); +void pika_lvgl_style_t_set_line_dash_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_line_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_line_rounded(PikaObj *self, int value); +void pika_lvgl_style_t_set_line_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_max_height(PikaObj *self, int value); +void pika_lvgl_style_t_set_max_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_min_height(PikaObj *self, int value); +void pika_lvgl_style_t_set_min_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_outline_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_outline_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_outline_pad(PikaObj *self, int value); +void pika_lvgl_style_t_set_outline_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_all(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_bottom(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_column(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_gap(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_hor(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_left(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_right(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_row(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_top(PikaObj *self, int value); +void pika_lvgl_style_t_set_pad_ver(PikaObj *self, int value); +void pika_lvgl_style_t_set_radius(PikaObj *self, int value); +void pika_lvgl_style_t_set_shadow_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_shadow_ofs_x(PikaObj *self, int value); +void pika_lvgl_style_t_set_shadow_ofs_y(PikaObj *self, int value); +void pika_lvgl_style_t_set_shadow_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_shadow_spread(PikaObj *self, int value); +void pika_lvgl_style_t_set_shadow_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_size(PikaObj *self, int value); +void pika_lvgl_style_t_set_text_align(PikaObj *self, int value); +void pika_lvgl_style_t_set_text_color(PikaObj *self, PikaObj* value); +void pika_lvgl_style_t_set_text_decor(PikaObj *self, int value); +void pika_lvgl_style_t_set_text_letter_space(PikaObj *self, int value); +void pika_lvgl_style_t_set_text_line_space(PikaObj *self, int value); +void pika_lvgl_style_t_set_text_opa(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_angle(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_height(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_pivot_x(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_pivot_y(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_transform_zoom(PikaObj *self, int value); +void pika_lvgl_style_t_set_translate_x(PikaObj *self, int value); +void pika_lvgl_style_t_set_translate_y(PikaObj *self, int value); +void pika_lvgl_style_t_set_width(PikaObj *self, int value); +void pika_lvgl_style_t_set_x(PikaObj *self, int value); +void pika_lvgl_style_t_set_y(PikaObj *self, int value); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_switch.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_switch.h new file mode 100644 index 00000000..5f7dac5f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_switch.h @@ -0,0 +1,22 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_switch__H +#define __pika_lvgl_switch__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_switch(Args *args); + +void pika_lvgl_switch___init__(PikaObj *self, PikaObj* parent); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_table.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_table.h new file mode 100644 index 00000000..5717dcab --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_table.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_table__H +#define __pika_lvgl_table__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_table(Args *args); + +void pika_lvgl_table___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_table_set_cell_value(PikaObj *self, int row, int col, char* txt); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/pika_lvgl_textarea.h b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_textarea.h new file mode 100644 index 00000000..49503c21 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/pika_lvgl_textarea.h @@ -0,0 +1,23 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __pika_lvgl_textarea__H +#define __pika_lvgl_textarea__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_pika_lvgl_textarea(Args *args); + +void pika_lvgl_textarea___init__(PikaObj *self, PikaObj* parent); +void pika_lvgl_textarea_set_one_line(PikaObj *self, int en); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/random.h b/examples/pikapython/pikapython/pikascript-api/random.h new file mode 100644 index 00000000..b9562a4c --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/random.h @@ -0,0 +1,27 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __random__H +#define __random__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_random(Args *args); + +void random___init__(PikaObj *self); +int random_randint(PikaObj *self, int a, int b); +pika_float random_random(PikaObj *self); +int random_randrange(PikaObj *self, int start, int stop, int step); +PikaObj* random_seed(PikaObj *self, int a); +pika_float random_uniform(PikaObj *self, pika_float a, pika_float b); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/re.h b/examples/pikapython/pikapython/pikascript-api/re.h new file mode 100644 index 00000000..5676d616 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/re.h @@ -0,0 +1,33 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __re__H +#define __re__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_re(Args *args); + +Arg* re_Match(PikaObj *self); +Arg* re_Pattern(PikaObj *self); +void re___init__(PikaObj *self); +PikaObj* re_compile(PikaObj *self, char* pattern, PikaTuple* flags); +char* re_escape(PikaObj *self, char* pattern); +PikaObj* re_findall(PikaObj *self, char* pattern, char* subject, PikaTuple* flags); +PikaObj* re_fullmatch(PikaObj *self, char* pattern, char* subject, PikaTuple* flags); +PikaObj* re_match(PikaObj *self, char* pattern, char* subject, PikaTuple* flags); +PikaObj* re_search(PikaObj *self, char* pattern, char* subject, PikaTuple* flags); +PikaObj* re_split(PikaObj *self, char* pattern, char* subject, PikaTuple* maxsplit__flags); +char* re_sub(PikaObj *self, char* pattern, char* repl, char* subjet, PikaTuple* count__flags); +PikaObj* re_subn(PikaObj *self, char* pattern, char* repl, char* subjet, PikaTuple* count__flags); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/re_Match.h b/examples/pikapython/pikapython/pikascript-api/re_Match.h new file mode 100644 index 00000000..9494f379 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/re_Match.h @@ -0,0 +1,26 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __re_Match__H +#define __re_Match__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_re_Match(Args *args); + +void re_Match___del__(PikaObj *self); +void re_Match___init__(PikaObj *self); +char* re_Match_group(PikaObj *self, PikaTuple* n); +PikaObj* re_Match_groups(PikaObj *self); +PikaObj* re_Match_span(PikaObj *self, PikaTuple* group_n); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/re_Pattern.h b/examples/pikapython/pikapython/pikascript-api/re_Pattern.h new file mode 100644 index 00000000..6b6efb95 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-api/re_Pattern.h @@ -0,0 +1,30 @@ +/* + * [Warning!] This file is auto-generated by pika compiler. + * Do not edit it manually. + * The source code is *.pyi file. + * More details: + * English Doc: + * https://pikadoc.readthedocs.io/en/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + * Chinese Doc: + * https://pikadoc.readthedocs.io/zh/latest/PikaScript%20%E6%A8%A1%E5%9D%97%E6%A6%82%E8%BF%B0.html + */ + +#ifndef __re_Pattern__H +#define __re_Pattern__H +#include +#include +#include "PikaObj.h" + +PikaObj *New_re_Pattern(Args *args); + +void re_Pattern___del__(PikaObj *self); +void re_Pattern___init__(PikaObj *self); +PikaObj* re_Pattern_findall(PikaObj *self, char* subject, PikaTuple* flags); +PikaObj* re_Pattern_fullmatch(PikaObj *self, char* subject, PikaTuple* flags); +PikaObj* re_Pattern_match(PikaObj *self, char* subject, PikaTuple* flags); +PikaObj* re_Pattern_search(PikaObj *self, char* subject, PikaTuple* flags); +PikaObj* re_Pattern_split(PikaObj *self, char* subject, PikaTuple* maxsplit__flags); +char* re_Pattern_sub(PikaObj *self, char* repl, char* subjet, PikaTuple* count__flags); +PikaObj* re_Pattern_subn(PikaObj *self, char* repl, char* subjet, PikaTuple* count__flags); + +#endif diff --git a/examples/pikapython/pikapython/pikascript-api/time.py.o b/examples/pikapython/pikapython/pikascript-api/time.py.o new file mode 100644 index 00000000..c6fabe92 Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/time.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-api/unittest.py.o b/examples/pikapython/pikapython/pikascript-api/unittest.py.o new file mode 100644 index 00000000..62f0418c Binary files /dev/null and b/examples/pikapython/pikapython/pikascript-api/unittest.py.o differ diff --git a/examples/pikapython/pikapython/pikascript-core/BaseObj.c b/examples/pikapython/pikapython/pikascript-core/BaseObj.c index bf47a06c..7f60ac1e 100644 --- a/examples/pikapython/pikapython/pikascript-core/BaseObj.c +++ b/examples/pikapython/pikapython/pikascript-core/BaseObj.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/BaseObj.h b/examples/pikapython/pikapython/pikascript-core/BaseObj.h index dd954df4..7ed7c51f 100644 --- a/examples/pikapython/pikapython/pikascript-core/BaseObj.h +++ b/examples/pikapython/pikapython/pikascript-core/BaseObj.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/PikaCompiler.c b/examples/pikapython/pikapython/pikascript-core/PikaCompiler.c index e18b5300..6801443c 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaCompiler.c +++ b/examples/pikapython/pikapython/pikascript-core/PikaCompiler.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -219,7 +219,7 @@ PIKA_RES pikaCompileFile(char* input_file_name) { } LibObj* New_LibObj(Args* args) { - LibObj* self = New_TinyObj(NULL); + LibObj* self = New_PikaObj(); return self; } @@ -300,8 +300,8 @@ int LibObj_staticLinkFile(LibObj* self, char* input_file_name) { return 0; } -static int32_t __foreach_handler_listModules(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { +static int32_t __foreach_handler_listModules(Arg* argEach, void* context) { + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); pika_platform_printf("%s\r\n", obj_getStr(module_obj, "name")); } @@ -312,9 +312,9 @@ void LibObj_listModules(LibObj* self) { args_foreach(self->list, __foreach_handler_listModules, NULL); } -static int32_t __foreach_handler_libWriteBytecode(Arg* argEach, Args* context) { - FILE* out_file = args_getPtr(context, "out_file"); - if (argType_isObject(arg_getType(argEach))) { +static int32_t __foreach_handler_libWriteBytecode(Arg* argEach, void* context) { + FILE* out_file = args_getPtr((Args*)context, "out_file"); + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); char* bytecode = obj_getPtr(module_obj, "bytecode"); size_t bytecode_size = obj_getBytesSize(module_obj, "buff"); @@ -327,10 +327,11 @@ static int32_t __foreach_handler_libWriteBytecode(Arg* argEach, Args* context) { return 0; } -static int32_t __foreach_handler_libWriteIndex(Arg* argEach, Args* context) { - FILE* out_file = args_getPtr(context, "out_file"); +static int32_t __foreach_handler_libWriteIndex(Arg* argEach, void* context) { + Args* args = context; + FILE* out_file = args_getPtr(args, "out_file"); Args buffs = {0}; - if (argType_isObject(arg_getType(argEach))) { + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); uint32_t bytecode_size = obj_getBytesSize(module_obj, "buff"); char buff[LIB_INFO_BLOCK_SIZE - sizeof(uint32_t)] = {0}; @@ -348,21 +349,22 @@ static int32_t __foreach_handler_libWriteIndex(Arg* argEach, Args* context) { return 0; } -static int32_t __foreach_handler_libSumSize(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { +static int32_t __foreach_handler_libSumSize(Arg* argEach, void* context) { + Args* args = context; + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); uint32_t bytecode_size = obj_getBytesSize(module_obj, "buff"); bytecode_size = aline_by(bytecode_size, sizeof(uint32_t)); - args_setInt(context, "sum_size", - args_getInt(context, "sum_size") + bytecode_size); + args_setInt(args, "sum_size", + args_getInt(args, "sum_size") + bytecode_size); } return 0; } -static int32_t __foreach_handler_getModuleNum(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { - args_setInt(context, "module_num", - args_getInt(context, "module_num") + 1); +static int32_t __foreach_handler_getModuleNum(Arg* argEach, void* context) { + Args* args = (Args*)context; + if (arg_isObject(argEach)) { + args_setInt(args, "module_num", args_getInt(args, "module_num") + 1); } return 0; } @@ -493,6 +495,40 @@ PIKA_RES _loadModuleDataWithName(uint8_t* library_bytes, return PIKA_RES_ERR_ARG_NO_FOUND; } +/** + * @brief 打开 .pack 文件,并返回这个pack 文件的library_bytes + * + * @param pikafs_FILE** fp pikafs_FILE + * 二级文件指针,提供了文件加载内存中的地址以及大小等信息 + * @param Arg** f_arg + * @param char* pack_name pack 文件的名字 + * @return PIKA_RES_OK when success, otherwise failed; + * @note if failed *fp if freed + * + */ +PIKA_RES _getPack_libraryBytes(pikafs_FILE** fp, Arg** f_arg, char* pack_name) { + if (NULL == pack_name) { + return PIKA_RES_ERR_INVALID_PTR; + } + + *fp = (pikafs_FILE*)pikaMalloc(sizeof(pikafs_FILE)); + if (NULL == *fp) { + pika_platform_printf("Error: malloc failed \r\n"); + return PIKA_RES_ERR_OUT_OF_RANGE; + } + memset(*fp, 0, sizeof(pikafs_FILE)); + + *f_arg = arg_loadFile(NULL, pack_name); + if (NULL == *f_arg) { + pika_platform_printf("Error: Could not load file \'%s\'\r\n", + pack_name); + pikaFree(*fp, sizeof(pikafs_FILE)); + // fp == NULL; + return PIKA_RES_ERR_IO_ERROR; + } + return PIKA_RES_OK; +} + int LibObj_loadLibrary(LibObj* self, uint8_t* library_bytes) { int module_num = _getModuleNum(library_bytes); if (module_num < 0) { @@ -510,8 +546,8 @@ int LibObj_loadLibrary(LibObj* self, uint8_t* library_bytes) { return PIKA_RES_OK; } -int32_t __foreach_handler_printModule(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { +int32_t __foreach_handler_printModule(Arg* argEach, void* context) { + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); char* module_name = obj_getStr(module_obj, "name"); if (NULL != module_name) { @@ -543,6 +579,60 @@ int LibObj_loadLibraryFile(LibObj* self, char* lib_file_name) { return PIKA_RES_OK; } +/** + * @brief unpack *.pack file to Specified path + * + * @param pack_name the name of *.pack file + * @param out_path output path + * @return + */ +PIKA_RES LibObj_unpackFileToPath(char* pack_name, char* out_path) { + PIKA_RES stat = PIKA_RES_OK; + Arg* file_arg = NULL; + uint8_t* library_bytes = NULL; + pikafs_FILE* fptr = NULL; + + stat = _getPack_libraryBytes(&fptr, &file_arg, pack_name); + if (PIKA_RES_OK == stat) { + library_bytes = arg_getBytes(file_arg); + } else { + return stat; + } + + int module_num = _getModuleNum(library_bytes); + if (module_num < 0) { + return (PIKA_RES)module_num; + } + + Args buffs = {0}; + char* output_file_path = NULL; + FILE* new_fp = NULL; + + for (int i = 0; i < module_num; ++i) { + char* name = NULL; + uint8_t* addr = NULL; + size_t size = 0; + _loadModuleDataWithIndex(library_bytes, module_num, i, &name, &addr, + &size); + output_file_path = strsPathJoin(&buffs, out_path, name); + new_fp = pika_platform_fopen(output_file_path, "wb+"); + if (NULL != new_fp) { + pika_platform_fwrite(addr, size, 1, new_fp); + pika_platform_fclose(new_fp); + pika_platform_printf("extract %s to %s\r\n", name, + output_file_path); + } else { + pika_platform_printf("can't open %s\r\n", output_file_path); + break; + } + } + + arg_deinit(file_arg); + strsDeinit(&buffs); + pikaFree(fptr, sizeof(pikafs_FILE)); + return PIKA_RES_OK; +} + size_t pika_fputs(char* str, FILE* fp) { size_t size = strGetSize(str); return pika_platform_fwrite(str, 1, size, fp); @@ -615,7 +705,7 @@ static PIKA_RES __Maker_compileModuleWithInfo(PikaMaker* self, } PikaMaker* New_PikaMaker(void) { - PikaMaker* self = New_TinyObj(NULL); + PikaMaker* self = New_PikaObj(); obj_setStr(self, "pwd", ""); obj_setInt(self, "err", 0); LibObj* lib = New_LibObj(NULL); @@ -703,7 +793,7 @@ int pikaMaker_getDependencies(PikaMaker* self, char* module_name) { if (NULL == ins_unit) { goto exit; } - if (instructUnit_getInstruct(ins_unit) == IMP) { + if (instructUnit_getInstructIndex(ins_unit) == IMP) { char* imp_module_name = constPool_getByOffset(const_pool, ins_unit->const_pool_index); char* imp_module_path = @@ -783,8 +873,8 @@ exit: return res; } -int32_t __foreach_handler_printStates(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { +int32_t __foreach_handler_printStates(Arg* argEach, void* context) { + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); pika_platform_printf("%s: %s\r\n", obj_getStr(module_obj, "name"), obj_getStr(module_obj, "state")); @@ -796,17 +886,17 @@ void pikaMaker_printStates(PikaMaker* self) { args_foreach(self->list, __foreach_handler_printStates, NULL); } -int32_t __foreach_handler_getFirstNocompiled(Arg* argEach, Args* context) { - if (argType_isObject(arg_getType(argEach))) { +int32_t __foreach_handler_getFirstNocompiled(Arg* argEach, void* context) { + if (arg_isObject(argEach)) { PikaObj* module_obj = arg_getPtr(argEach); char* state = obj_getStr(module_obj, "state"); - if (args_isArgExist(context, "res")) { + if (args_isArgExist((Args*)context, "res")) { /* already get method */ return 0; } if (strEqu("nocompiled", state)) { /* push module */ - args_setStr(context, "res", obj_getStr(module_obj, "name")); + args_setStr((Args*)context, "res", obj_getStr(module_obj, "name")); return 0; } } @@ -858,11 +948,11 @@ PIKA_RES pikaMaker_compileModuleWithDepends(PikaMaker* self, return PIKA_RES_OK; } -int32_t __foreach_handler_linkCompiledModules(Arg* argEach, Args* context) { +int32_t __foreach_handler_linkCompiledModules(Arg* argEach, void* context) { Args buffs = {0}; - if (argType_isObject(arg_getType(argEach))) { - LibObj* lib = args_getPtr(context, "@lib"); - PikaMaker* maker = args_getPtr(context, "__maker"); + if (arg_isObject(argEach)) { + LibObj* lib = args_getPtr((Args*)context, "@lib"); + PikaMaker* maker = args_getPtr((Args*)context, "__maker"); PikaObj* module_obj = arg_getPtr(argEach); char* module_name = obj_getStr(module_obj, "name"); char* state = obj_getStr(module_obj, "state"); @@ -960,6 +1050,27 @@ pikafs_FILE* pikafs_fopen(char* file_name, char* mode) { return f; } +pikafs_FILE* pikafs_fopen_pack(char* pack_name, char* file_name) { + pikafs_FILE* f = NULL; + Arg* file_arg = NULL; + PIKA_RES stat = PIKA_RES_OK; + uint8_t* library_bytes = NULL; + stat = _getPack_libraryBytes(&f, &file_arg, pack_name); + if (PIKA_RES_OK == stat) { + library_bytes = arg_getBytes(file_arg); + } else { + return NULL; + } + + if (PIKA_RES_OK != + _loadModuleDataWithName(library_bytes, file_name, &f->addr, &f->size)) { + return NULL; + } + + arg_deinit(file_arg); + return f; +} + /* * @brief read file * @param buf the buffer to read diff --git a/examples/pikapython/pikapython/pikascript-core/PikaCompiler.h b/examples/pikapython/pikapython/pikascript-core/PikaCompiler.h index 8f4dadfb..dd5cb871 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaCompiler.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaCompiler.h @@ -19,6 +19,7 @@ int LibObj_staticLinkFile(LibObj* self, char* input_file_name); void LibObj_listModules(LibObj* self); int LibObj_saveLibraryFile(LibObj* self, char* output_file_name); int LibObj_loadLibraryFile(LibObj* self, char* input_file_name); +PIKA_RES LibObj_unpackFileToPath(char* pack_name, char* out_path); int Lib_loadLibraryFileToArray(char* origin_file_name, char* pikascript_root); PikaMaker* New_PikaMaker(void); void pikaMaker_setPWD(PikaMaker* self, char* pwd); @@ -55,6 +56,7 @@ typedef struct { } pikafs_FILE; pikafs_FILE* pikafs_fopen(char* file_name, char* mode); +pikafs_FILE* pikafs_fopen_pack(char* pack_name, char* file_name); int pikafs_fread(void* buf, size_t size, size_t count, pikafs_FILE* file); int pikafs_fwrite(void* buf, size_t size, size_t count, pikafs_FILE* file); int pikafs_fclose(pikafs_FILE* file); diff --git a/examples/pikapython/pikapython/pikascript-core/PikaObj.c b/examples/pikapython/pikapython/pikascript-core/PikaObj.c index d1b4d1cf..2d43ddad 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaObj.c +++ b/examples/pikapython/pikapython/pikascript-core/PikaObj.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -31,14 +31,36 @@ #include "BaseObj.h" #include "PikaCompiler.h" #include "PikaPlatform.h" +#include "dataArg.h" #include "dataArgs.h" #include "dataMemory.h" #include "dataQueue.h" #include "dataString.h" #include "dataStrs.h" -static volatile Arg* _help_modules_cmodule = NULL; -static volatile PIKA_BOOL in_root_obj = PIKA_FALSE; +extern volatile VMSignal g_PikaVMSignal; +volatile PikaObjState g_PikaObjState = { + .helpModulesCmodule = NULL, + .inRootObj = PIKA_FALSE, +#if PIKA_GC_MARK_SWEEP_ENABLE + .objCnt = 0, + .objCntMax = 0, + .objCntLastGC = 0, + .gcChain = NULL, + .markSweepBusy = 0, +#endif +}; + +PikaObj* New_PikaStdData_Dict(Args* args); +PikaObj* New_PikaStdData_dict_keys(Args* args); +PikaObj* New_PikaStdData_List(Args* args); +PikaObj* New_PikaStdData_Tuple(Args* args); +void _mem_cache_deinit(void); +void _VMEvent_deinit(void); +void pikaGC_markObj(PikaGC* gc, PikaObj* self); +void _pikaGC_mark(PikaGC* gc); +void obj_dump(PikaObj* self); +void Locals_deinit(PikaObj* self); static enum shellCTRL __obj_shellLineHandler_REPL(PikaObj* self, char* input_line, @@ -108,14 +130,28 @@ char* fast_itoa(char* buf, uint32_t val) { static int32_t obj_deinit_no_del(PikaObj* self) { /* free the list */ + Locals_deinit(self); args_deinit(self->list); +#if PIKA_KERNAL_DEBUG_ENABLE + if (NULL != self->aName) { + arg_deinit(self->aName); + } +#endif + extern volatile PikaObj* __pikaMain; + /* remove self from gc chain */ + obj_removeGcChain(self); /* free the pointer */ pikaFree(self, sizeof(PikaObj)); - self = NULL; + if (self == (PikaObj*)__pikaMain) { + __pikaMain = NULL; + } return 0; } int obj_GC(PikaObj* self) { + if (!obj_checkAlive(self)) { + return 0; + } obj_refcntDec(self); int ref_cnt = obj_refcntNow(self); if (ref_cnt <= 0) { @@ -125,6 +161,11 @@ int obj_GC(PikaObj* self) { } int32_t obj_deinit(PikaObj* self) { + pikaGC_lock(); + PIKA_BOOL bisRoot = PIKA_FALSE; +#if PIKA_KERNAL_DEBUG_ENABLE + self->isAlive = PIKA_FALSE; +#endif Arg* del = obj_getMethodArg(self, "__del__"); if (NULL != del) { const uint8_t bytes[] = { @@ -139,19 +180,22 @@ int32_t obj_deinit(PikaObj* self) { } extern volatile PikaObj* __pikaMain; if (self == (PikaObj*)__pikaMain) { - void _mem_cache_deinit(void); - void _VMEvent_deinit(void); + bisRoot = PIKA_TRUE; _mem_cache_deinit(); #if PIKA_EVENT_ENABLE _VMEvent_deinit(); #endif - if (NULL != _help_modules_cmodule) { - arg_deinit((Arg*)_help_modules_cmodule); - _help_modules_cmodule = NULL; + if (NULL != g_PikaObjState.helpModulesCmodule) { + arg_deinit(g_PikaObjState.helpModulesCmodule); + g_PikaObjState.helpModulesCmodule = NULL; } - __pikaMain = NULL; } - return obj_deinit_no_del(self); + int32_t ret = obj_deinit_no_del(self); + pikaGC_unlock(); + if (bisRoot) { + pikaGC_markSweep(); + } + return ret; } PIKA_RES obj_setInt(PikaObj* self, char* argPath, int64_t val) { @@ -248,6 +292,7 @@ PIKA_BOOL obj_getBool(PikaObj* self, char* argPath) { } Arg* obj_getArg(PikaObj* self, char* argPath) { + pika_assert(obj_checkAlive(self)); PIKA_BOOL is_temp = PIKA_FALSE; PikaObj* obj = obj_getHostObjWithIsTemp(self, argPath, &is_temp); if (NULL == obj) { @@ -295,34 +340,73 @@ size_t obj_loadBytes(PikaObj* self, char* argPath, uint8_t* out_buff) { return size_mem; } -static PIKA_RES __obj_setArg(PikaObj* self, - char* argPath, - Arg* arg, - uint8_t is_copy) { +void obj_setName(PikaObj* self, char* name) { +#if !PIKA_KERNAL_DEBUG_ENABLE + return; +#else + if (strEqu(name, "self")) { + return; + } + if (NULL != self->aName) { + if (!strstr(self->name, name)) { + self->aName = arg_strAppend(self->aName, "|"); + self->aName = arg_strAppend(self->aName, name); + } + } else { + self->aName = arg_newStr(name); + } + self->name = arg_getStr(self->aName); +#endif +} + +static PIKA_RES _obj_setArg(PikaObj* self, + char* argPath, + Arg* arg, + uint8_t is_copy) { + pika_assert(obj_checkAlive(self)); /* setArg would copy arg */ - PikaObj* obj = obj_getHostObj(self, argPath); - if (NULL == obj) { + PikaObj* host = obj_getHostObj(self, argPath); + PikaObj* oNew = NULL; + PIKA_BOOL bNew = PIKA_FALSE; + if (NULL == host) { /* object no found */ return PIKA_RES_ERR_ARG_NO_FOUND; } - char* argName = strPointToLastToken(argPath, '.'); - Arg* newArg; + char* sArgName = strPointToLastToken(argPath, '.'); + Arg* aNew; if (is_copy) { - newArg = arg_copy(arg); + aNew = arg_copy(arg); } else { - newArg = arg; + aNew = arg; + } + aNew = arg_setName(aNew, sArgName); + if (arg_isObject(aNew)) { + oNew = arg_getPtr(aNew); + bNew = PIKA_TRUE; + pika_assert(obj_checkAlive(oNew)); +#if PIKA_KERNAL_DEBUG_ENABLE + if (host != oNew) { + /* skip self ref */ + oNew->parent = host; + } +#endif + obj_setName(oNew, sArgName); + } + args_setArg(host->list, aNew); + /* enable mark sweep to collect this object */ + if (bNew) { + /* only enable mark sweep after setArg */ + obj_enableGC(oNew); } - newArg = arg_setName(newArg, argName); - args_setArg(obj->list, newArg); return PIKA_RES_OK; } PIKA_RES obj_setArg(PikaObj* self, char* argPath, Arg* arg) { - return __obj_setArg(self, argPath, arg, 1); + return _obj_setArg(self, argPath, arg, 1); }; PIKA_RES obj_setArg_noCopy(PikaObj* self, char* argPath, Arg* arg) { - return __obj_setArg(self, argPath, arg, 0); + return _obj_setArg(self, argPath, arg, 0); } void* obj_getPtr(PikaObj* self, char* argPath) { @@ -355,15 +439,13 @@ char* obj_getStr(PikaObj* self, char* argPath) { return res; } -PikaObj* obj_getClassObjByNewFun(PikaObj* context, - char* name, - NewFun newClassFun) { - Args* initArgs = New_args(NULL); - PikaObj* thisClass = newClassFun(initArgs); - thisClass->constructor = newClassFun; - thisClass->refcnt = 0; - args_deinit(initArgs); - return thisClass; +PikaObj* obj_newObjFromConstructor(PikaObj* context, + char* name, + NewFun constructor) { + PikaObj* self = constructor(NULL); + self->constructor = constructor; + self->refcnt = 1; + return self; } Arg* _obj_getProp(PikaObj* obj, char* name) { @@ -428,19 +510,16 @@ exit: } Arg* _obj_getMethodArg(PikaObj* obj, char* methodPath, Arg* arg_reg) { - Arg* method = NULL; + Arg* aMethod = NULL; char* methodName = strPointToLastToken(methodPath, '.'); - method = obj_getArg(obj, methodName); - if (NULL != method) { - method = arg_copy_noalloc(method, arg_reg); - goto exit; - } - method = _obj_getProp(obj, methodName); - if (NULL != method) { + aMethod = obj_getArg(obj, methodName); + if (NULL != aMethod) { + aMethod = arg_copy_noalloc(aMethod, arg_reg); goto exit; } + aMethod = _obj_getProp(obj, methodName); exit: - return method; + return aMethod; } Arg* obj_getMethodArg(PikaObj* obj, char* methodPath) { @@ -460,7 +539,7 @@ PikaObj* obj_getClassObj(PikaObj* obj) { if (NULL == classPtr) { return NULL; } - PikaObj* classObj = obj_getClassObjByNewFun(obj, "", classPtr); + PikaObj* classObj = obj_newObjFromConstructor(obj, "", classPtr); return classObj; } @@ -480,8 +559,7 @@ PikaObj* removeMethodInfo(PikaObj* thisClass) { } PikaObj* newNormalObj(NewFun newObjFun) { - PikaObj* thisClass = obj_getClassObjByNewFun(NULL, "", newObjFun); - obj_refcntInc(thisClass); + PikaObj* thisClass = obj_newObjFromConstructor(NULL, "", newObjFun); obj_setFlag(thisClass, OBJ_FLAG_ALREADY_INIT); return removeMethodInfo(thisClass); } @@ -519,7 +597,7 @@ static volatile uint8_t logo_printed = 0; extern volatile PikaObj* __pikaMain; PikaObj* newRootObj(char* name, NewFun newObjFun) { - in_root_obj = PIKA_TRUE; + g_PikaObjState.inRootObj = PIKA_TRUE; #if PIKA_POOL_ENABLE mem_pool_init(); #endif @@ -534,8 +612,14 @@ PikaObj* newRootObj(char* name, NewFun newObjFun) { pika_platform_printf("~ pikascript.com ~\r\n"); pika_platform_printf("~~~~~~~~~~~~~~~~~~~~\r\n"); } + if (NULL != __pikaMain) { + pika_platform_printf("Error: root object already exists\r\n"); + pika_platform_panic_handle(); + return NULL; + } __pikaMain = newObj; - in_root_obj = PIKA_FALSE; + obj_setName(newObj, name); + g_PikaObjState.inRootObj = PIKA_FALSE; return newObj; } @@ -556,23 +640,24 @@ Arg* obj_newObjInPackage(NewFun new_obj_fun) { return arg_newDirectObj(new_obj_fun); } -static PikaObj* __obj_initSubObj(PikaObj* obj, char* name) { +static PikaObj* _obj_initMetaObj(PikaObj* obj, char* name) { PikaObj* res = NULL; NewFun constructor = (NewFun)getNewClassObjFunByName(obj, name); Args buffs = {0}; PikaObj* thisClass; - PikaObj* new_obj; + PikaObj* oNew; if (NULL == constructor) { /* no such object */ res = NULL; goto exit; } - thisClass = obj_getClassObjByNewFun(obj, name, constructor); - new_obj = removeMethodInfo(thisClass); - obj_refcntInc(new_obj); - obj_runNativeMethod(new_obj, "__init__", NULL); - args_setPtrWithType(obj->list, name, ARG_TYPE_OBJECT, new_obj); + thisClass = obj_newObjFromConstructor(obj, name, constructor); + oNew = removeMethodInfo(thisClass); + obj_setName(oNew, name); + obj_runNativeMethod(oNew, "__init__", NULL); + args_setPtrWithType(obj->list, name, ARG_TYPE_OBJECT, oNew); res = obj_getPtr(obj, name); + // pikaGC_enable(res); goto exit; exit: strsDeinit(&buffs); @@ -583,7 +668,7 @@ PikaObj* _arg_to_obj(Arg* self, PIKA_BOOL* pIsTemp) { if (NULL == self) { return NULL; } - if (argType_isObject(arg_getType(self))) { + if (arg_isObject(self)) { return arg_getPtr(self); } #if !PIKA_NANO_ENABLE @@ -609,9 +694,9 @@ PikaObj* _arg_to_obj(Arg* self, PIKA_BOOL* pIsTemp) { return NULL; } -static PikaObj* __obj_getObjDirect(PikaObj* self, - char* name, - PIKA_BOOL* pIsTemp) { +static PikaObj* _obj_getObjDirect(PikaObj* self, + char* name, + PIKA_BOOL* pIsTemp) { *pIsTemp = PIKA_FALSE; if (NULL == self) { return NULL; @@ -628,7 +713,7 @@ static PikaObj* __obj_getObjDirect(PikaObj* self, type = arg_getType(arg_obj); /* found meta Object */ if (type == ARG_TYPE_OBJECT_META) { - return __obj_initSubObj(self, name); + return _obj_initMetaObj(self, name); } /* found Objcet */ if (argType_isObject(type)) { @@ -653,10 +738,10 @@ static PikaObj* __obj_getObjDirect(PikaObj* self, return _arg_to_obj(arg_obj, pIsTemp); } -static PikaObj* __obj_getObjWithKeepDeepth(PikaObj* self, - char* objPath, - PIKA_BOOL* pIsTemp, - int32_t keepDeepth) { +static PikaObj* _obj_getObjWithKeepDeepth(PikaObj* self, + char* objPath, + PIKA_BOOL* pIsTemp, + int32_t keepDeepth) { char objPath_buff[PIKA_PATH_BUFF_SIZE]; char* objPath_ptr = objPath_buff; strcpy(objPath_buff, objPath); @@ -664,30 +749,33 @@ static PikaObj* __obj_getObjWithKeepDeepth(PikaObj* self, PikaObj* obj = self; for (int32_t i = 0; i < token_num - keepDeepth; i++) { char* token = strPopFirstToken(&objPath_ptr, '.'); - obj = __obj_getObjDirect(obj, token, pIsTemp); + obj = _obj_getObjDirect(obj, token, pIsTemp); if (obj == NULL) { goto exit; } } goto exit; exit: + if (NULL != obj) { + pika_assert(obj_checkAlive(obj)); + } return obj; } PikaObj* obj_getObj(PikaObj* self, char* objPath) { PIKA_BOOL is_temp = PIKA_FALSE; - return __obj_getObjWithKeepDeepth(self, objPath, &is_temp, 0); + return _obj_getObjWithKeepDeepth(self, objPath, &is_temp, 0); } PikaObj* obj_getHostObj(PikaObj* self, char* objPath) { PIKA_BOOL is_temp = PIKA_FALSE; - return __obj_getObjWithKeepDeepth(self, objPath, &is_temp, 1); + return _obj_getObjWithKeepDeepth(self, objPath, &is_temp, 1); } PikaObj* obj_getHostObjWithIsTemp(PikaObj* self, char* objPath, PIKA_BOOL* pIsTemp) { - return __obj_getObjWithKeepDeepth(self, objPath, pIsTemp, 1); + return _obj_getObjWithKeepDeepth(self, objPath, pIsTemp, 1); } Method methodArg_getPtr(Arg* method_arg) { @@ -719,6 +807,9 @@ PikaObj* methodArg_getHostObj(Arg* method_arg) { } int methodArg_setHostObj(Arg* method_arg, PikaObj* host_obj) { + if (arg_getType(method_arg) != ARG_TYPE_METHOD_OBJECT) { + return -1; + } MethodProp* prop = (MethodProp*)arg_getContent(method_arg); if (prop->host_obj == NULL) { prop->host_obj = host_obj; @@ -791,28 +882,28 @@ void _update_proxy(PikaObj* self, char* name) { } } -static void obj_saveMethodInfo(PikaObj* self, MethodInfo* method_info) { - Arg* arg = New_arg(NULL); - MethodProp method_store = { - .ptr = method_info->ptr, - .type_list = method_info->typelist, - .name = method_info->name, - .bytecode_frame = method_info->bytecode_frame, - .def_context = method_info->def_context, - .declareation = method_info->dec, // const +static void obj_saveMethodInfo(PikaObj* self, MethodInfo* tInfo) { + Arg* aMethod = New_arg(NULL); + MethodProp tProp = { + .ptr = tInfo->ptr, + .type_list = tInfo->typelist, + .name = tInfo->name, + .bytecode_frame = tInfo->bytecode_frame, + .def_context = tInfo->def_context, + .declareation = tInfo->dec, // const .host_obj = NULL, }; - char* name = method_info->name; - if (NULL == method_info->name) { + char* name = tInfo->name; + if (NULL == tInfo->name) { char name_buff[PIKA_LINE_BUFF_SIZE / 2] = {0}; - name = strGetFirstToken(name_buff, method_info->dec, '('); + name = strGetFirstToken(name_buff, tInfo->dec, '('); } /* the first arg_value */ - arg = arg_setStruct(arg, name, &method_store, sizeof(method_store)); - pika_assert(NULL != arg); - arg_setType(arg, method_info->type); + aMethod = arg_setStruct(aMethod, name, &tProp, sizeof(tProp)); + pika_assert(NULL != aMethod); + arg_setType(aMethod, tInfo->type); _update_proxy(self, name); - args_setArg(self->list, arg); + args_setArg(self->list, aMethod); } static int32_t __class_defineMethodWithType(PikaObj* self, @@ -1336,8 +1427,8 @@ enum shellCTRL _do_obj_runChar(PikaObj* self, int16_t n = byte_count; while (n--) { - PIKA_BOOL result = byteQueue_readOne(queue, (uint8_t*)&inputChar); - pika_assert(result != PIKA_FALSE); + result = byteQueue_readOne(queue, (uint8_t*)&inputChar); + pika_assert(PIKA_FALSE != result); if (SHELL_CTRL_EXIT == _inner_do_obj_runChar(self, inputChar, shell)) { @@ -1384,6 +1475,13 @@ static void _save_file(char* file_name, uint8_t* buff, size_t size) { } } +char _await_getchar(sh_getchar fn_getchar) { + pika_GIL_EXIT(); + char ret = fn_getchar(); + pika_GIL_ENTER(); + return ret; +} + void _do_pikaScriptShell(PikaObj* self, ShellConfig* cfg) { /* init the shell */ _obj_runChar_beforeRun(self, cfg); @@ -1392,7 +1490,7 @@ void _do_pikaScriptShell(PikaObj* self, ShellConfig* cfg) { char inputChar[2] = {0}; while (1) { inputChar[1] = inputChar[0]; - inputChar[0] = cfg->fn_getchar(); + inputChar[0] = _await_getchar(cfg->fn_getchar); #if !PIKA_NANO_ENABLE /* run python script */ if (inputChar[0] == '!' && inputChar[1] == '#') { @@ -1646,13 +1744,345 @@ char* method_getStr(Args* args, char* argName) { return args_getStr(args, argName); } +#if PIKA_GC_MARK_SWEEP_ENABLE +PikaObj* pikaGC_getLast(PikaObj* self) { + PikaObj* obj = g_PikaObjState.gcChain; + PikaObj* last = NULL; + while (NULL != obj) { + if (obj == self) { + return last; + } + last = obj; + obj = obj->gcNext; + } + return NULL; +} + +void pikaGC_clean(PikaGC* gc) { + PikaObj* obj = g_PikaObjState.gcChain; + while (NULL != obj) { + obj_clearFlag(obj, OBJ_FLAG_GC_MARKED); + // obj->gcRoot = NULL; + obj = obj->gcNext; + } +} + +uint32_t pikaGC_count(void) { + uint32_t count = 0; + PikaObj* obj = g_PikaObjState.gcChain; + while (NULL != obj) { + count++; + obj = obj->gcNext; + } + return count; +} + +uint32_t pikaGC_countMarked(void) { + uint32_t count = 0; + PikaObj* obj = g_PikaObjState.gcChain; + while (NULL != obj) { + if (obj_getFlag(obj, OBJ_FLAG_GC_MARKED)) { + count++; + } + obj = obj->gcNext; + } + return count; +} + +uint32_t pikaGC_printFreeList(void) { + uint32_t count = 0; + PikaObj* obj = g_PikaObjState.gcChain; + pika_platform_printf("-----\r\n"); + while (NULL != obj) { + if (!obj_getFlag(obj, OBJ_FLAG_GC_MARKED)) { + count++; + pika_platform_printf("gc free: "); + obj_dump(obj); + } + obj = obj->gcNext; + } + pika_platform_printf("-----\r\n"); + return count; +} + +void obj_dump(PikaObj* self) { +#if PIKA_KERNAL_DEBUG_ENABLE + pika_platform_printf("[\033[32m%s\033[0m]", self->name); +#endif + pika_platform_printf(" \033[36m@%p\033[0m", self); + pika_platform_printf("\r\n"); +} + +uint32_t pikaGC_markSweepOnce(PikaGC* gc) { + _pikaGC_mark(gc); + uint32_t count = 0; + PikaObj* freeList[16] = {0}; + PikaObj* obj = g_PikaObjState.gcChain; + while (NULL != obj) { + if (!obj_getFlag(obj, OBJ_FLAG_GC_MARKED)) { + if (count > dimof(freeList) - 1) { + break; + } + freeList[count] = obj; + count++; + } + obj = obj->gcNext; + } + if (count > 0) { + // pikaGC_markDump(); + // pikaGC_printFreeList(); + for (uint32_t i = 0; i < count; i++) { + pika_platform_printf("GC Free:"); + obj_dump(freeList[i]); + } + for (uint32_t i = 0; i < count; i++) { + obj_GC(freeList[i]); + } + } + return count; +} + +int32_t _pikaGC_markHandler(Arg* argEach, void* context) { + PikaGC* gc = (PikaGC*)context; + if (arg_isObject(argEach)) { + PikaObj* obj = (PikaObj*)arg_getPtr(argEach); +#if PIKA_KERNAL_DEBUG_ENABLE + obj->gcRoot = (void*)gc->oThis; +#endif + pikaGC_markObj(gc, obj); + } + return 0; +} + +void pikaGC_markObj(PikaGC* gc, PikaObj* self) { + gc->oThis = self; + gc->markDeepth++; + if (NULL == self) { + goto __exit; + } + if (obj_getFlag(self, OBJ_FLAG_GC_MARKED)) { + goto __exit; + } + obj_setFlag(self, OBJ_FLAG_GC_MARKED); + if (NULL != gc->onMarkObj) { + gc->onMarkObj(gc); + } + args_foreach(self->list, _pikaGC_markHandler, gc); + if (self->constructor == New_PikaStdData_Dict) { + PikaDict* dict = obj_getPtr(self, "dict"); + if (NULL == dict) { + goto __exit; + } + args_foreach(&dict->super, _pikaGC_markHandler, (void*)gc); + goto __exit; + } + if (self->constructor == New_PikaStdData_List || + self->constructor == New_PikaStdData_Tuple) { + PikaList* list = obj_getPtr(self, "list"); + if (NULL == list) { + goto __exit; + } + args_foreach(&list->super, _pikaGC_markHandler, (void*)gc); + goto __exit; + } +__exit: + gc->markDeepth--; + return; +} + +void _pikaGC_mark(PikaGC* gc) { + pikaGC_clean(gc); + PikaObj* root = g_PikaObjState.gcChain; + while (NULL != root) { + if (obj_getFlag(root, OBJ_FLAG_GC_ROOT)) { + pikaGC_markObj(gc, root); + } + root = root->gcNext; + } +} + +void pikaGC_mark(void) { + PikaGC gc = {0}; + _pikaGC_mark(&gc); +} + +int _pikaGC_markDumpHandler(PikaGC* gc) { + for (uint32_t i = 0; i < gc->markDeepth - 1; i++) { + pika_platform_printf(" |"); + } + if (gc->markDeepth != 1) { + pika_platform_printf("- "); + } + obj_dump(gc->oThis); + return 0; +} + +#endif + +PIKA_BOOL obj_checkAlive(PikaObj* self) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return PIKA_TRUE; +#else + PIKA_BOOL ret = PIKA_FALSE; + if (NULL == g_PikaObjState.gcChain) { + ret = PIKA_FALSE; + goto __exit; + } + PikaObj* obj = g_PikaObjState.gcChain; + while (NULL != obj) { + if (obj == self) { + ret = PIKA_TRUE; + goto __exit; + } + obj = obj->gcNext; + } +__exit: +#if PIKA_KERNAL_DEBUG_ENABLE + if (ret == PIKA_TRUE) { + self->isAlive = ret; + } +#endif + return ret; +#endif +} + +uint32_t pikaGC_markSweep(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return 0; +#else + PikaGC gc = {0}; + uint32_t count = 0; + if (pikaGC_islock()) { + return 0; + } + pikaGC_lock(); + while (pikaGC_markSweepOnce(&gc) != 0) { + count++; + }; + if (count > 0) { + // pikaGC_markDump(); + } + /* update gc state */ + g_PikaObjState.objCntLastGC = g_PikaObjState.objCnt; + pikaGC_unlock(); + return count; +#endif +} + +void pikaGC_markDump(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + PikaGC gc = {0}; + pika_platform_printf( + "\033[31m" + "========= PIKA GC DUMP =========\r\n" + "\033[0m"); + gc.onMarkObj = _pikaGC_markDumpHandler; + _pikaGC_mark(&gc); +#endif +} + +void pikaGC_checkThreshold(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + if (g_PikaObjState.objCnt > + g_PikaObjState.objCntLastGC + PIKA_GC_MARK_SWEEP_THRESHOLD) { + pikaGC_markSweep(); + } +#endif +} + +void pikaGC_append(PikaObj* self) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + g_PikaObjState.objCnt++; + if (g_PikaObjState.objCntMax < g_PikaObjState.objCnt) { + g_PikaObjState.objCntMax = g_PikaObjState.objCnt; + } + /* gc single chain */ + if (NULL == g_PikaObjState.gcChain) { + g_PikaObjState.gcChain = self; + return; + } + /* append to head of gc chain */ + self->gcNext = g_PikaObjState.gcChain; + g_PikaObjState.gcChain = self; +#endif +} + +void obj_removeGcChain(PikaObj* self) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + g_PikaObjState.objCnt--; + PikaObj* last = pikaGC_getLast(self); + if (NULL == last) { + /* remove head */ + g_PikaObjState.gcChain = self->gcNext; + return; + } + last->gcNext = self->gcNext; +#endif +} + +void obj_enableGC(PikaObj* self) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + obj_clearFlag(self, OBJ_FLAG_GC_ROOT); +#endif +} + +void pikaGC_lock(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + g_PikaObjState.markSweepBusy++; +#endif +} + +void pikaGC_unlock(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return; +#else + g_PikaObjState.markSweepBusy--; +#endif +} + +PIKA_BOOL pikaGC_islock(void) { +#if !PIKA_GC_MARK_SWEEP_ENABLE + return PIKA_FALSE; +#else + return g_PikaObjState.markSweepBusy > 0; +#endif +} + PikaObj* New_PikaObj(void) { PikaObj* self = pikaMalloc(sizeof(PikaObj)); /* List */ self->list = New_args(NULL); self->refcnt = 0; - self->constructor = NULL; + self->constructor = New_PikaObj; self->flag = 0; +#if PIKA_GC_MARK_SWEEP_ENABLE + self->gcNext = NULL; + obj_setFlag(self, OBJ_FLAG_GC_ROOT); +#endif +#if PIKA_KERNAL_DEBUG_ENABLE + self->aName = NULL; + self->name = "PikaObj"; + self->parent = NULL; + self->isAlive = PIKA_TRUE; +#endif +#if PIKA_GC_MARK_SWEEP_ENABLE && PIKA_KERNAL_DEBUG_ENABLE + self->gcRoot = NULL; +#endif + /* append to gc chain */ + pikaGC_append(self); + pikaGC_checkThreshold(); return self; } @@ -1667,29 +2097,31 @@ Arg* arg_setRef(Arg* self, char* name, PikaObj* obj) { } int32_t obj_newDirectObj(PikaObj* self, char* objName, NewFun newFunPtr) { - Arg* new_obj = arg_newDirectObj(newFunPtr); - new_obj = arg_setName(new_obj, objName); - arg_setType(new_obj, ARG_TYPE_OBJECT); - args_setArg(self->list, new_obj); + Arg* aNewObj = arg_newDirectObj(newFunPtr); + aNewObj = arg_setName(aNewObj, objName); + obj_setName(arg_getPtr(aNewObj), objName); + arg_setType(aNewObj, ARG_TYPE_OBJECT); + // pikaGC_enable(arg_getPtr(aNewObj)); + args_setArg(self->list, aNewObj); return 0; } int32_t obj_newMetaObj(PikaObj* self, char* objName, NewFun newFunPtr) { /* add meta Obj, no inited */ - Arg* new_obj = arg_newMetaObj(newFunPtr); - new_obj = arg_setName(new_obj, objName); - args_setArg(self->list, new_obj); + Arg* aMetaObj = arg_newMetaObj(newFunPtr); + aMetaObj = arg_setName(aMetaObj, objName); + args_setArg(self->list, aMetaObj); return 0; } static void _append_help(char* name) { - if (NULL == _help_modules_cmodule) { - _help_modules_cmodule = (volatile Arg*)arg_newStr(""); + if (NULL == g_PikaObjState.helpModulesCmodule) { + g_PikaObjState.helpModulesCmodule = arg_newStr(""); } - Arg* _help = (Arg*)_help_modules_cmodule; + Arg* _help = g_PikaObjState.helpModulesCmodule; _help = arg_strAppend(_help, name); _help = arg_strAppend(_help, "\r\n"); - _help_modules_cmodule = (volatile Arg*)_help; + g_PikaObjState.helpModulesCmodule = _help; } int32_t obj_newObj(PikaObj* self, @@ -1697,7 +2129,7 @@ int32_t obj_newObj(PikaObj* self, char* className, NewFun newFunPtr) { /* before init root object */ - if (in_root_obj) { + if (g_PikaObjState.inRootObj) { _append_help(objName); } return obj_newMetaObj(self, objName, newFunPtr); @@ -1708,18 +2140,20 @@ PikaObj* obj_importModuleWithByteCode(PikaObj* self, uint8_t* byteCode) { PikaObj* New_PikaStdLib_SysObj(Args * args); if (!obj_isArgExist((PikaObj*)__pikaMain, name)) { + /* import to main module context */ obj_newDirectObj((PikaObj*)__pikaMain, name, New_PikaStdLib_SysObj); pikaVM_runByteCode(obj_getObj((PikaObj*)__pikaMain, name), (uint8_t*)byteCode); } if (self != (PikaObj*)__pikaMain) { - Arg* module_arg = obj_getArg((PikaObj*)__pikaMain, name); - PikaObj* module_obj = arg_getPtr(module_arg); - obj_setArg(self, name, module_arg); + /* import to other module context */ + Arg* aModule = obj_getArg((PikaObj*)__pikaMain, name); + PikaObj* oModule = arg_getPtr(aModule); + obj_setArg(self, name, aModule); arg_setIsWeakRef(obj_getArg(self, name), PIKA_TRUE); - pika_assert(argType_isObject(arg_getType(module_arg))); + pika_assert(arg_isObject(aModule)); /* decrase refcnt to avoid circle reference */ - obj_refcntDec(module_obj); + obj_refcntDec(oModule); } return self; } @@ -1733,11 +2167,10 @@ PikaObj* obj_importModuleWithByteCodeFrame(PikaObj* self, return self; } -PikaObj* obj_linkLibraryFile(PikaObj* self, char* input_file_name) { +int obj_linkLibraryFile(PikaObj* self, char* input_file_name) { obj_newMetaObj(self, "@lib", New_LibObj); LibObj* lib = obj_getObj(self, "@lib"); - LibObj_loadLibraryFile(lib, input_file_name); - return self; + return LibObj_loadLibraryFile(lib, input_file_name); } PikaObj* obj_linkLibrary(PikaObj* self, uint8_t* library_bytes) { @@ -1750,12 +2183,12 @@ PikaObj* obj_linkLibrary(PikaObj* self, uint8_t* library_bytes) { void obj_printModules(PikaObj* self) { LibObj* lib = obj_getObj(self, "@lib"); - pika_platform_printf(arg_getStr((Arg*)_help_modules_cmodule)); + pika_platform_printf(arg_getStr((Arg*)g_PikaObjState.helpModulesCmodule)); LibObj_printModules(lib); } PikaObj* obj_linkLibObj(PikaObj* self, LibObj* library) { - obj_setPtr(self, "@lib", library); + obj_setRef(self, "@lib", library); return self; } @@ -1795,26 +2228,25 @@ int obj_importModule(PikaObj* self, char* module_name) { } char* obj_toStr(PikaObj* self) { - /* clang-format off */ - PIKA_PYTHON( - __res = __str__() - ) - /* clang-format on */ - /* check method arg */ - Arg* method_arg = obj_getMethodArg(self, "__str__"); - if (NULL != method_arg) { - arg_deinit(method_arg); + Arg* aMethod = obj_getMethodArg(self, "__str__"); + if (NULL != aMethod) { + arg_deinit(aMethod); + /* clang-format off */ + PIKA_PYTHON( + @res_str = __str__() + ) + /* clang-format on */ const uint8_t bytes[] = { 0x08, 0x00, 0x00, 0x00, /* instruct array size */ - 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x09, 0x00, /* instruct - array */ - 0x0f, 0x00, 0x00, 0x00, /* const pool size */ - 0x00, 0x5f, 0x5f, 0x73, 0x74, 0x72, 0x5f, 0x5f, 0x00, - 0x5f, 0x5f, 0x72, 0x65, 0x73, 0x00, /* const pool */ + 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x09, 0x00, /* instruct array */ + 0x12, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x5f, 0x5f, 0x73, 0x74, 0x72, 0x5f, 0x5f, 0x00, 0x40, + 0x72, 0x65, 0x73, 0x5f, 0x73, 0x74, 0x72, 0x00, /* const pool */ }; pikaVM_runByteCode(self, (uint8_t*)bytes); - char* str_res = obj_getStr(self, "__res"); + char* str_res = obj_cacheStr(self, obj_getStr(self, "@res_str")); + obj_removeArg(self, "@res_str"); return str_res; } @@ -1822,9 +2254,9 @@ char* obj_toStr(PikaObj* self) { Args buffs = {0}; char* str_res = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "", self); - obj_setStr(self, "__res", str_res); + obj_setStr(self, "@res_str", str_res); strsDeinit(&buffs); - return obj_getStr(self, "__res"); + return obj_getStr(self, "@res_str"); } void pks_eventListener_registEvent(PikaEventListener* self, @@ -1839,8 +2271,8 @@ void pks_eventListener_registEvent(PikaEventListener* self, strsDeinit(&buffs); } +Args buffs = {0}; void pks_eventListener_removeEvent(PikaEventListener* self, uint32_t eventId) { - Args buffs = {0}; char* event_name = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%ld", eventId); obj_removeArg(self, event_name); @@ -1906,6 +2338,15 @@ Arg* __eventListener_runEvent_dataInt(PikaEventListener* lisener, return __eventListener_runEvent(lisener, eventId, arg_newInt(eventSignal)); } +static void _thread_event(void* arg) { + while (1) { + _VMEvent_pickupEvent(); + pika_GIL_EXIT(); + pika_platform_thread_delay(); + pika_GIL_ENTER(); + } +} + void _do_pks_eventListener_send(PikaEventListener* self, uint32_t eventId, Arg* eventData, @@ -1919,11 +2360,26 @@ void _do_pks_eventListener_send(PikaEventListener* self, if (PIKA_RES_OK != __eventListener_pushEvent(self, eventId, eventData)) { } if (pickupWhenNoVM) { - if (0 == _VMEvent_getVMCnt()) { + int vmCnt = _VMEvent_getVMCnt(); + pika_debug("vmCnt: %d", vmCnt); + if (0 == vmCnt) { /* no vm running, pick up event imediately */ _VMEvent_pickupEvent(); } } +#if PIKA_EVENT_THREAD_ENABLE + if (g_PikaVMSignal.event_thread_inited) { + return; + } + /* using multi thread */ + if (_VM_is_first_lock()) { + pika_platform_thread_init("pika_event", _thread_event, NULL, + PIKA_THREAD_STACK_SIZE, PIKA_THREAD_PRIO, + PIKA_THREAD_TICK); + pika_debug("event thread init"); + g_PikaVMSignal.event_thread_inited = 1; + } +#endif #endif } @@ -1950,11 +2406,11 @@ Arg* pks_eventListener_sendSignalAwaitResult(PikaEventListener* self, while (1) { }; #else - extern volatile VMSignal PikaVMSignal; - int tail = PikaVMSignal.cq.tail; + extern volatile VMSignal g_PikaVMSignal; + int tail = g_PikaVMSignal.cq.tail; pks_eventListener_sendSignal(self, eventId, eventSignal); while (1) { - Arg* res = PikaVMSignal.cq.res[tail]; + Arg* res = g_PikaVMSignal.cq.res[tail]; pika_platform_thread_delay(); if (NULL != res) { return res; @@ -1976,6 +2432,7 @@ void pks_getVersion(char* buff) { } void* obj_getStruct(PikaObj* self, char* name) { + pika_assert(self != NULL); return args_getStruct(self->list, name); } diff --git a/examples/pikapython/pikapython/pikascript-core/PikaObj.h b/examples/pikapython/pikapython/pikascript-core/PikaObj.h index 1e4637ce..820df136 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaObj.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaObj.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -32,8 +32,8 @@ #include "dataArgs.h" #include "dataLink.h" #include "dataMemory.h" -#include "dataStrs.h" #include "dataQueue.h" +#include "dataStrs.h" typedef struct InstructUnit InstructUnit; struct InstructUnit { @@ -78,11 +78,32 @@ struct NativeProperty { typedef struct PikaObj PikaObj; struct PikaObj { Args* list; - uint8_t refcnt; void* constructor; +#if PIKA_GC_MARK_SWEEP_ENABLE + PikaObj* gcNext; +#endif +#if PIKA_KERNAL_DEBUG_ENABLE + char* name; + Arg* aName; + PikaObj* parent; + PIKA_BOOL isAlive; + PIKA_BOOL isGCRoot; +#endif +#if PIKA_GC_MARK_SWEEP_ENABLE && PIKA_KERNAL_DEBUG_ENABLE + PikaObj* gcRoot; +#endif + uint8_t refcnt; uint8_t flag; }; +typedef struct PikaGC PikaGC; +typedef int (*pikaGC_hook)(PikaGC* gc); +struct PikaGC { + uint32_t markDeepth; + pikaGC_hook onMarkObj; + PikaObj* oThis; +}; + typedef struct RangeData RangeData; struct RangeData { int64_t start; @@ -91,12 +112,27 @@ struct RangeData { int64_t i; }; -#define OBJ_FLAG_PROXY_GETATTRIBUTE 0x01 -#define OBJ_FLAG_PROXY_GETATTR 0x02 -#define OBJ_FLAG_PROXY_SETATTR 0x04 -#define OBJ_FLAG_ALREADY_INIT 0x08 -#define OBJ_FLAG_RUN_AS 0x16 -#define OBJ_FLAG_GLOBALS 0x32 +typedef struct PikaObjState PikaObjState; +struct PikaObjState { + Arg* helpModulesCmodule; + PIKA_BOOL inRootObj; +#if PIKA_GC_MARK_SWEEP_ENABLE + PikaObj* gcChain; + uint32_t objCnt; + uint32_t objCntMax; + uint32_t objCntLastGC; + uint32_t markSweepBusy; +#endif +}; + +#define OBJ_FLAG_PROXY_GETATTRIBUTE 1 << 0 +#define OBJ_FLAG_PROXY_GETATTR 1 << 1 +#define OBJ_FLAG_PROXY_SETATTR 1 << 2 +#define OBJ_FLAG_ALREADY_INIT 1 << 3 +#define OBJ_FLAG_RUN_AS 1 << 4 +#define OBJ_FLAG_GLOBALS 1 << 5 +#define OBJ_FLAG_GC_MARKED 1 << 6 +#define OBJ_FLAG_GC_ROOT 1 << 7 #define KEY_UP 0x41 #define KEY_DOWN 0x42 @@ -104,15 +140,27 @@ struct RangeData { #define KEY_LEFT 0x44 static inline uint8_t obj_getFlag(PikaObj* self, uint8_t flag) { + pika_assert(self); return (self->flag & flag) == flag; } static inline void obj_setFlag(PikaObj* self, uint8_t flag) { + pika_assert(self); self->flag |= flag; +#if PIKA_KERNAL_DEBUG_ENABLE + if (flag == OBJ_FLAG_GC_ROOT) { + self->isGCRoot = PIKA_TRUE; + } +#endif } static inline void obj_clearFlag(PikaObj* self, uint8_t flag) { self->flag &= ~flag; +#if PIKA_KERNAL_DEBUG_ENABLE + if (flag == OBJ_FLAG_GC_ROOT) { + self->isGCRoot = PIKA_FALSE; + } +#endif } typedef PikaObj* (*NewFun)(Args* args); @@ -228,7 +276,9 @@ int32_t class_defineRunTimeConstructor(PikaObj* self, int32_t obj_removeArg(PikaObj* self, char* argPath); int32_t obj_isArgExist(PikaObj* self, char* argPath); -PikaObj* obj_getClassObjByNewFun(PikaObj* self, char* name, NewFun newClassFun); +PikaObj* obj_newObjFromConstructor(PikaObj* self, + char* name, + NewFun newClassFun); PikaObj* newRootObj(char* name, NewFun newObjFun); PikaObj* obj_getClassObj(PikaObj* obj); Arg* obj_getMethodArg(PikaObj* obj, char* methodPath); @@ -268,6 +318,7 @@ Method methodArg_getPtr(Arg* method_arg); VMParameters* obj_run(PikaObj* self, char* cmd); PikaObj* New_PikaObj(void); +PikaObj* New_PikaObj_noGC(void); /* tools */ int64_t fast_atoi(char* src); @@ -281,7 +332,6 @@ typedef struct ShellConfig ShellConfig; typedef enum shellCTRL (*sh_handler)(PikaObj*, char*, ShellConfig*); typedef char (*sh_getchar)(void); - #if PIKA_SHELL_FILTER_ENABLE typedef struct FilterFIFO { ByteQueue queue; @@ -291,19 +341,19 @@ typedef struct FilterFIFO { typedef struct FilterItem FilterItem; -typedef PIKA_BOOL FilterMessageHandler( FilterItem *msg, - PikaObj* self, - ShellConfig* shell); +typedef PIKA_BOOL FilterMessageHandler(FilterItem* msg, + PikaObj* self, + ShellConfig* shell); struct FilterItem { - FilterMessageHandler *handler; - const uint8_t *message; - uint16_t size; - uint8_t is_visible : 1; - uint8_t is_case_insensitive : 1; - uint8_t : 6; - uint8_t ignore_mask; - uintptr_t target; + FilterMessageHandler* handler; + const uint8_t* message; + uint16_t size; + uint8_t is_visible : 1; + uint8_t is_case_insensitive : 1; + uint8_t : 6; + uint8_t ignore_mask; + uintptr_t target; }; #endif @@ -311,9 +361,9 @@ struct FilterItem { struct ShellConfig { #if PIKA_SHELL_FILTER_ENABLE FilterFIFO filter_fifo; - FilterItem *messages; + FilterItem* messages; uint16_t message_count; - uint16_t : 16; /* padding to suppress warning*/ + uint16_t : 16; /* padding to suppress warning*/ #endif char* prefix; sh_handler handler; @@ -346,6 +396,20 @@ PikaObj* newNormalObj(NewFun newObjFun); Arg* arg_setRef(Arg* self, char* name, PikaObj* obj); Arg* arg_setObj(Arg* self, char* name, PikaObj* obj); +static inline void arg_setObjFlag(Arg* self, uint8_t flag) { + if (!arg_isObject(self)) { + return; + } + obj_setFlag((PikaObj*)arg_getPtr(self), flag); +} + +static inline void arg_clearObjFlag(Arg* self, uint8_t flag) { + if (!arg_isObject(self)) { + return; + } + obj_clearFlag((PikaObj*)arg_getPtr(self), flag); +} + static inline Arg* arg_newObj(PikaObj* obj) { return arg_setObj(NULL, (char*)"", (obj)); } @@ -408,7 +472,7 @@ PikaObj* pks_eventListener_getEventHandleObj(PikaEventListener* self, void pks_eventListener_init(PikaEventListener** p_self); void pks_eventListener_deinit(PikaEventListener** p_self); PikaObj* methodArg_getDefContext(Arg* method_arg); -PikaObj* obj_linkLibraryFile(PikaObj* self, char* input_file_name); +int obj_linkLibraryFile(PikaObj* self, char* input_file_name); NewFun obj_getClass(PikaObj* obj); void pks_printVersion(void); @@ -566,6 +630,36 @@ void obj_printModules(PikaObj* self); } while (0) #endif +#define pika_assert_arg_alive(__arg) \ + do { \ + if (NULL != (__arg)) { \ + if (arg_isObject((__arg))) { \ + pika_assert(obj_checkAlive(arg_getPtr((__arg)))); \ + } \ + } \ + } while (0) + +#define pika_assert_obj_alive(__obj) \ + do { \ + pika_assert(obj_checkAlive((__obj))); \ + } while (0) + +void obj_appendGcChain(PikaObj* self); +void obj_removeGcChain(PikaObj* self); +void obj_enableGC(PikaObj* self); +PIKA_BOOL obj_checkAlive(PikaObj* self); +void obj_setName(PikaObj* self, char* name); + +void pikaGC_mark(void); +void pikaGC_markDump(void); +void pikaGC_lock(void); +void pikaGC_unlock(void); +PIKA_BOOL pikaGC_islock(void); +uint32_t pikaGC_count(void); +uint32_t pikaGC_countMarked(void); +uint32_t pikaGC_markSweep(void); +uint32_t pikaGC_printFreeList(void); + int pika_GIL_EXIT(void); int pika_GIL_ENTER(void); diff --git a/examples/pikapython/pikapython/pikascript-core/PikaParser.c b/examples/pikapython/pikapython/pikascript-core/PikaParser.c index 69c0fac1..8ea1cabb 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaParser.c +++ b/examples/pikapython/pikapython/pikascript-core/PikaParser.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -370,7 +370,8 @@ uint8_t Parser_checkIsDirect(char* str) { Args buffs = {0}; uint8_t res = 0; pika_assert(NULL != str); - if (Cursor_isContain(str, TOKEN_operator, "=")) { + char* left = Cursor_splitCollect(&buffs, str, "=", 1); + if (!strEqu(left, str)) { res = 1; goto exit; } @@ -768,9 +769,9 @@ char* Token_getPyload(char* token) { return (char*)((uintptr_t)token + 1); } -uint8_t TokenStream_isContain(char* tokenStream, - enum TokenType token_type, - char* pyload) { +uint8_t TokenStream_count(char* tokenStream, + enum TokenType token_type, + char* pyload) { Args buffs = {0}; char* tokenStream_buff = strsCopy(&buffs, tokenStream); uint8_t res = 0; @@ -779,16 +780,23 @@ uint8_t TokenStream_isContain(char* tokenStream, char* token = TokenStream_pop(&buffs, &tokenStream_buff); if (token_type == Token_getType(token)) { if (strEqu(Token_getPyload(token), pyload)) { - res = 1; - goto exit; + res++; } } } -exit: strsDeinit(&buffs); return res; } +uint8_t TokenStream_isContain(char* tokenStream, + enum TokenType token_type, + char* pyload) { + if (TokenStream_count(tokenStream, token_type, pyload) > 0) { + return 1; + } + return 0; +} + static char* _solveEqualLevelOperator(Args* buffs, char* operator, @@ -963,21 +971,25 @@ void _Cursor_beforeIter(struct Cursor* cs) { cs->last_token = arg_newStr(TokenStream_pop(cs->buffs_p, &cs->tokenStream)); } -PIKA_BOOL Cursor_isContain(char* stmt, TokenType type, char* pyload) { +uint8_t Cursor_count(char* stmt, TokenType type, char* pyload) { /* fast return */ if (!strstr(stmt, pyload)) { return PIKA_FALSE; } Args buffs = {0}; - PIKA_BOOL res = PIKA_FALSE; char* tokenStream = Lexer_getTokenStream(&buffs, stmt); - if (TokenStream_isContain(tokenStream, type, pyload)) { - res = PIKA_TRUE; - } + uint8_t res = TokenStream_count(tokenStream, type, pyload); strsDeinit(&buffs); return res; } +PIKA_BOOL Cursor_isContain(char* stmt, TokenType type, char* pyload) { + if (Cursor_count(stmt, type, pyload) > 0) { + return PIKA_TRUE; + } + return PIKA_FALSE; +} + char* Cursor_popToken(Args* buffs, char** pStmt, char* devide) { Arg* out_item = arg_newStr(""); Arg* tokenStream_after = arg_newStr(""); @@ -1565,11 +1577,11 @@ char* Suger_not_in(Args* out_buffs, char* line) { PIKA_BOOL got_not_in = PIKA_FALSE; PIKA_BOOL skip = PIKA_FALSE; Args buffs = {0}; - if (!Cursor_isContain(line, TOKEN_operator, " not ")) { + if (1 != Cursor_count(line, TOKEN_operator, " not ")) { ret = line; goto __exit; } - if (!Cursor_isContain(line, TOKEN_operator, " in ")) { + if (1 != Cursor_count(line, TOKEN_operator, " in ")) { ret = line; goto __exit; } @@ -1651,14 +1663,18 @@ AST* AST_parseStmt(AST* ast, char* stmt) { isLeftExist = Suger_selfOperator(&buffs, stmt, &right, &left); } + /* remove hint */ + if (isLeftExist) { + left = Cursor_splitCollect(&buffs, left, ":", 0); + } + /* solve the [] stmt */ right = Suger_leftSlice(&buffs, right, &left); right = Suger_format(&buffs, right); /* set left */ if (isLeftExist) { - char* left_without_hint = Cursor_splitCollect(&buffs, left, ":", 0); - AST_setNodeAttr(ast, (char*)"left", left_without_hint); + AST_setNodeAttr(ast, (char*)"left", left); } /* match statment type */ enum StmtType stmtType = Lexer_matchStmtType(right); @@ -1800,7 +1816,7 @@ static int32_t Parser_getPyLineBlockDeepth(char* line) { return -1; } -char* Parser_removeAnnotation(char* line) { +char* Parser_removeComment(char* line) { uint8_t is_annotation_exit = 0; uint8_t is_in_single_quotes = 0; uint8_t is_in_pika_float_quotes_deepth = 0; @@ -1851,13 +1867,13 @@ char* _defGetDefault(Args* outBuffs, char** psDeclearOut) { char* sArgList = strsCut(&buffs, sDeclear, '(', ')'); char* sDefaultOut = NULL; pika_assert(NULL != sArgList); - int argNum = strCountSign(sArgList, ',') + 1; + int argNum = Cursor_count(sArgList, TOKEN_devider, ",") + 1; for (int i = 0; i < argNum; i++) { - char* sItem = strsPopToken(&buffs, &sArgList, ','); + char* sItem = Cursor_popToken(&buffs, &sArgList, ","); char* sDefaultVal = NULL; char* sDefaultKey = NULL; int is_default = 0; - if (strIsContain(sItem, '=')) { + if (Cursor_isContain(sItem, TOKEN_operator, "=")) { /* has default value */ sDefaultVal = Cursor_splitCollect(&buffs, sItem, "=", 1); sDefaultKey = Cursor_splitCollect(&buffs, sItem, "=", 0); @@ -1911,12 +1927,12 @@ const char control_keywords[][9] = {"break", "continue"}; const char normal_keywords[][7] = {"while", "if", "elif"}; AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, - Stack* block_stack, + Stack* tBlockStack, int block_deepth) { Stack s; stack_init(&s); - if (block_stack == NULL) { - block_stack = &s; + if (tBlockStack == NULL) { + tBlockStack = &s; } /* line is not exist */ if (line == NULL) { @@ -1943,7 +1959,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, obj_setInt(ast, "blockDeepth", block_deepth_now); /* check if exit block */ - block_deepth_last = stack_getTop(block_stack) + block_deepth; + block_deepth_last = stack_getTop(tBlockStack) + block_deepth; /* exit each block */ for (int i = 0; i < block_deepth_last - block_deepth_now; i++) { QueueObj* exit_block_queue = obj_getObj(ast, "exitBlock"); @@ -1954,7 +1970,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, queueObj_init(exit_block_queue); } char buff[10] = {0}; - char* block_type = stack_popStr(block_stack, buff); + char* block_type = stack_popStr(tBlockStack, buff); /* push exit block type to exit_block queue */ queueObj_pushStr(exit_block_queue, block_type); } @@ -1970,7 +1986,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, (line_start[keyword_len] == ' ')) { stmt = strsCut(&buffs, line_start, ' ', ':'); AST_setNodeBlock(ast, keyword); - stack_pushStr(block_stack, keyword); + stack_pushStr(tBlockStack, keyword); goto block_matched; } } @@ -2003,14 +2019,14 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, char* arg_in = strsPopToken(list_buffs, &line_buff, ' '); AST_setNodeAttr(ast, "arg_in", arg_in); strsPopToken(list_buffs, &line_buff, ' '); - char* list_in = strsPopToken(list_buffs, &line_buff, ':'); + char* list_in = Cursor_splitCollect(list_buffs, line_buff, ":", 0); list_in = strsAppend(list_buffs, "iter(", list_in); list_in = strsAppend(list_buffs, list_in, ")"); list_in = strsCopy(&buffs, list_in); args_deinit(list_buffs); AST_setNodeBlock(ast, "for"); AST_setNodeAttr(ast, "list_in", list_in); - stack_pushStr(block_stack, "for"); + stack_pushStr(tBlockStack, "for"); stmt = list_in; goto block_matched; } @@ -2020,7 +2036,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, if ((line_start[4] == ' ') || (line_start[4] == ':')) { stmt = ""; AST_setNodeBlock(ast, "else"); - stack_pushStr(block_stack, "else"); + stack_pushStr(tBlockStack, "else"); } goto block_matched; } @@ -2031,7 +2047,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, if ((line_start[3] == ' ') || (line_start[3] == ':')) { stmt = ""; AST_setNodeBlock(ast, "try"); - stack_pushStr(block_stack, "try"); + stack_pushStr(tBlockStack, "try"); } goto block_matched; } @@ -2041,7 +2057,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, if ((line_start[6] == ' ') || (line_start[6] == ':')) { stmt = ""; AST_setNodeBlock(ast, "except"); - stack_pushStr(block_stack, "except"); + stack_pushStr(tBlockStack, "except"); } goto block_matched; } @@ -2116,25 +2132,25 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, } if (strIsStartWith(line_start, (char*)"def ")) { stmt = ""; - char* declare = strsCut(&buffs, line_start, ' ', ':'); - if (NULL == declare) { + char* sDeclare = strsCut(&buffs, line_start, ' ', ':'); + if (NULL == sDeclare) { obj_deinit(ast); ast = NULL; goto exit; } - declare = Cursor_getCleanStmt(&buffs, declare); - if (!strIsContain(declare, '(') || !strIsContain(declare, ')')) { + sDeclare = Cursor_getCleanStmt(&buffs, sDeclare); + if (!strIsContain(sDeclare, '(') || !strIsContain(sDeclare, ')')) { obj_deinit(ast); ast = NULL; goto exit; } - char* defaultStmt = _defGetDefault(&buffs, &declare); + char* sDefaultStmt = _defGetDefault(&buffs, &sDeclare); AST_setNodeBlock(ast, "def"); - AST_setNodeAttr(ast, "declare", declare); - if (defaultStmt[0] != '\0') { - AST_setNodeAttr(ast, "default", defaultStmt); + AST_setNodeAttr(ast, "declare", sDeclare); + if (sDefaultStmt[0] != '\0') { + AST_setNodeAttr(ast, "default", sDefaultStmt); } - stack_pushStr(block_stack, "def"); + stack_pushStr(tBlockStack, "def"); goto block_matched; } if (strIsStartWith(line_start, (char*)"class ")) { @@ -2148,7 +2164,7 @@ AST* AST_parseLine_withBlockStack_withBlockDeepth(char* line, declare = Cursor_getCleanStmt(&buffs, declare); AST_setNodeBlock(ast, "class"); AST_setNodeAttr(ast, "declare", declare); - stack_pushStr(block_stack, "class"); + stack_pushStr(tBlockStack, "class"); goto block_matched; } @@ -2407,7 +2423,7 @@ static char* Suger_import(Args* outbuffs, char* line) { } static char* Parser_linePreProcess(Args* outbuffs, char* line) { - line = Parser_removeAnnotation(line); + line = Parser_removeComment(line); Arg* line_buff = NULL; int line_num = 0; /* check syntex error */ @@ -2485,168 +2501,180 @@ static int Parser_isVoidLine(char* line) { return 1; } -static uint8_t Parser_checkIsMultiComment(char* line) { - for (uint32_t i = 0; i < strGetSize(line); i++) { +static uint8_t Parser_checkIsMultiComment(char* line, uint8_t* pbIsOneLine) { + uint8_t bIsMultiComment = 0; + uint32_t i = 0; + uint32_t uLineSize = strGetSize(line); + while (i + 2 < uLineSize) { /* not match ' or " */ if ((line[i] != '\'') && (line[i] != '"')) { + i++; continue; } /* not match ''' or """ */ if (!((line[i + 1] == line[i]) && (line[i + 2] == line[i]))) { + i++; continue; } - /* check char befor the ''' or """ */ - if (!((0 == i) || (line[i - 1] == ' '))) { - continue; + if (bIsMultiComment) { + *pbIsOneLine = 1; } - /* check char after the ''' or """ */ - if (!((line[i + 3] == ' ') || (line[i + 3] == 0))) { - continue; - } - /* mached */ - return 1; + bIsMultiComment = 1; + i += 3; } - /* not mached */ - return 0; + return bIsMultiComment; } static char* _Parser_linesToBytesOrAsm(Args* outBuffs, ByteCodeFrame* bytecode_frame, - char* py_lines) { - Stack block_stack; - stack_init(&block_stack); - Arg* asm_buff = arg_newStr(""); - uint32_t lines_offset = 0; - uint16_t lines_num = strCountSign(py_lines, '\n') + 1; - uint16_t lines_index = 0; - uint8_t is_in_multi_comment = 0; - Arg* line_connection_arg = arg_newStr(""); - uint8_t is_line_connection = 0; - char* out_ASM = NULL; - char* single_ASM = NULL; - uint32_t line_size = 0; + char* sPyLines) { + Stack tBlockStack; + stack_init(&tBlockStack); + Arg* aAsm = arg_newStr(""); + uint32_t uLinesOffset = 0; + uint16_t uLinesNum = strCountSign(sPyLines, '\n') + 1; + uint16_t uLinesIndex = 0; + uint8_t bIsInMultiComment = 0; + uint8_t bIsOneLineMultiComment = 0; + Arg* aLineConnection = arg_newStr(""); + uint8_t bIsLineConnection = 0; + char* sOutASM = NULL; + char* sSingleASM = NULL; + uint32_t uLineSize = 0; /* parse each line */ while (1) { - lines_index++; + uLinesIndex++; Args buffs = {0}; - char* line_origin = NULL; - char* line = NULL; + char* sLineOrigin = NULL; + char* sLine = NULL; /* add void line to the end */ - if (lines_index >= lines_num + 1) { - line = ""; + if (uLinesIndex >= uLinesNum + 1) { + sLine = ""; goto parse_line; } /* get single line by pop multiline */ - line_origin = strsGetFirstToken(&buffs, py_lines + lines_offset, '\n'); + sLineOrigin = strsGetFirstToken(&buffs, sPyLines + uLinesOffset, '\n'); + + sLine = strsCopy(&buffs, sLineOrigin); - line = strsCopy(&buffs, line_origin); /* line connection */ - if (is_line_connection) { - is_line_connection = 0; - line_connection_arg = arg_strAppend(line_connection_arg, line); - line = strsCopy(&buffs, arg_getStr(line_connection_arg)); + if (bIsLineConnection) { + bIsLineConnection = 0; + aLineConnection = arg_strAppend(aLineConnection, sLine); + sLine = strsCopy(&buffs, arg_getStr(aLineConnection)); /* reflash the line_connection_arg */ - arg_deinit(line_connection_arg); - line_connection_arg = arg_newStr(""); + arg_deinit(aLineConnection); + aLineConnection = arg_newStr(""); } /* check connection */ - if ('\\' == line[strGetSize(line) - 1]) { + if ('\\' == sLine[strGetSize(sLine) - 1]) { /* remove the '\\' */ - line[strGetSize(line) - 1] = '\0'; - is_line_connection = 1; - line_connection_arg = arg_strAppend(line_connection_arg, line); + sLine[strGetSize(sLine) - 1] = '\0'; + bIsLineConnection = 1; + aLineConnection = arg_strAppend(aLineConnection, sLine); goto next_line; } - Cursor_forEach(c, line) { + + /* filter for not end \n */ + if (Parser_isVoidLine(sLine)) { + goto next_line; + } + + /* filter for multiline comment ''' or """ */ + if (Parser_checkIsMultiComment(sLine, &bIsOneLineMultiComment)) { + bIsInMultiComment = ~bIsInMultiComment; + /* skip one line multiline comment */ + if (bIsOneLineMultiComment) { + bIsInMultiComment = 0; + bIsOneLineMultiComment = 0; + } + goto next_line; + } + + /* skip multiline comment */ + if (bIsInMultiComment) { + goto next_line; + } + + /* support Tab */ + sLine = strsReplace(&buffs, sLine, "\t", " "); + /* remove \r */ + sLine = strsReplace(&buffs, sLine, "\r", ""); + + /* check auto connection */ + Cursor_forEach(c, sLine) { Cursor_iterStart(&c); Cursor_iterEnd(&c); } Cursor_deinit(&c); /* auto connection */ - if (lines_index < lines_num) { + if (uLinesIndex < uLinesNum) { if (c.branket_deepth > 0) { - line_connection_arg = arg_strAppend(line_connection_arg, line); - is_line_connection = 1; + aLineConnection = arg_strAppend(aLineConnection, sLine); + bIsLineConnection = 1; goto next_line; } } /* branket match failed */ if (c.branket_deepth != 0) { - single_ASM = NULL; + sSingleASM = NULL; goto parse_after; } - /* support Tab */ - line = strsReplace(&buffs, line, "\t", " "); - /* remove \r */ - line = strsReplace(&buffs, line, "\r", ""); - - /* filter for not end \n */ - if (Parser_isVoidLine(line)) { - goto next_line; - } - - /* filter for multiline comment ''' or """ */ - if (Parser_checkIsMultiComment(line)) { - is_in_multi_comment = ~is_in_multi_comment; - goto next_line; - } - - /* skipe multiline comment */ - if (is_in_multi_comment) { - goto next_line; - } - parse_line: /* parse single Line to Asm */ - single_ASM = Parser_LineToAsm(&buffs, line, &block_stack); + sSingleASM = Parser_LineToAsm(&buffs, sLine, &tBlockStack); parse_after: - if (NULL == single_ASM) { - out_ASM = NULL; + if (NULL == sSingleASM) { + sOutASM = NULL; + pika_platform_printf( + "----------[%d]----------\r\n%s\r\n-------------------------" + "\r\n", + uLinesIndex, sLine); strsDeinit(&buffs); goto exit; } if (NULL == bytecode_frame) { /* store ASM */ - asm_buff = arg_strAppend(asm_buff, single_ASM); + aAsm = arg_strAppend(aAsm, sSingleASM); } else if (NULL == outBuffs) { /* store ByteCode */ - byteCodeFrame_appendFromAsm(bytecode_frame, single_ASM); + byteCodeFrame_appendFromAsm(bytecode_frame, sSingleASM); } next_line: - if (lines_index < lines_num) { - line_size = strGetSize(line_origin); - lines_offset = lines_offset + line_size + 1; + if (uLinesIndex < uLinesNum) { + uLineSize = strGetSize(sLineOrigin); + uLinesOffset = uLinesOffset + uLineSize + 1; } strsDeinit(&buffs); /* exit when finished */ - if (lines_index >= lines_num + 1) { + if (uLinesIndex >= uLinesNum + 1) { break; } } if (NULL != outBuffs) { /* load stored ASM */ - out_ASM = strsCopy(outBuffs, arg_getStr(asm_buff)); + sOutASM = strsCopy(outBuffs, arg_getStr(aAsm)); } else { - out_ASM = (char*)1; + sOutASM = (char*)1; } goto exit; exit: - if (NULL != asm_buff) { - arg_deinit(asm_buff); + if (NULL != aAsm) { + arg_deinit(aAsm); } - if (NULL != line_connection_arg) { - arg_deinit(line_connection_arg); + if (NULL != aLineConnection) { + arg_deinit(aLineConnection); } - stack_deinit(&block_stack); - return out_ASM; + stack_deinit(&tBlockStack); + return sOutASM; }; PIKA_RES Parser_linesToBytes(ByteCodeFrame* bf, char* py_lines) { @@ -2683,8 +2711,12 @@ char* Parser_fileToAsm(Args* outBuffs, char* filename) { /* add '\n' at the end */ lines = strsAppend(&buffs, lines, "\n\n"); char* res = Parser_linesToAsm(&buffs, lines); - arg_deinit(file_arg); + if (NULL == res) { + goto __exit; + } res = strsCopy(outBuffs, res); +__exit: + arg_deinit(file_arg); strsDeinit(&buffs); return res; } @@ -2779,7 +2811,7 @@ char* GenRule_toAsm(GenRule rule, return pikaAsm; } -char* AST_genAsm(AST* ast, Args* outBuffs) { +char* AST_genAsm(AST* oAST, Args* outBuffs) { const GenRule rules_topAst[] = { {.ins = "CTN", .type = VAL_NONEVAL, .ast = "continue"}, {.ins = "BRK", .type = VAL_NONEVAL, .ast = "break"}, @@ -2799,14 +2831,14 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { }; Args buffs = {0}; - char* pikaAsm = strsCopy(&buffs, ""); + char* sPikaAsm = strsCopy(&buffs, ""); QueueObj* exitBlock; uint8_t is_block_matched; - if (NULL == ast) { - pikaAsm = NULL; + if (NULL == oAST) { + sPikaAsm = NULL; goto exit; } - exitBlock = obj_getObj(ast, "exitBlock"); + exitBlock = obj_getObj(oAST, "exitBlock"); /* exiting from block */ if (exitBlock != NULL) { while (1) { @@ -2818,81 +2850,82 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { } /* goto the while start when exit while block */ if (strEqu(block_type, "while")) { - pikaAsm = - ASM_addBlockDeepth(ast, outBuffs, pikaAsm, block_type_num); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 JMP -1\n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 JMP -1\n"); } #if PIKA_SYNTAX_EXCEPTION_ENABLE /* goto the while start when exit while block */ if (strEqu(block_type, "try")) { - pikaAsm = - ASM_addBlockDeepth(ast, outBuffs, pikaAsm, block_type_num); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 NTR \n"); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 GER \n"); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 JEZ 2\n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 NTR \n"); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 GER \n"); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 JEZ 2\n"); } #endif /* goto the while start when exit while block */ if (strEqu(block_type, "for")) { - pikaAsm = - ASM_addBlockDeepth(ast, outBuffs, pikaAsm, block_type_num); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 JMP -1\n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 JMP -1\n"); /* garbage collect for the list */ - pikaAsm = - ASM_addBlockDeepth(ast, outBuffs, pikaAsm, block_type_num); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num); char _l_x[] = "$lx"; char block_deepth_char = - AST_getBlockDeepthNow(ast) + block_type_num + '0'; + AST_getBlockDeepthNow(oAST) + block_type_num + '0'; _l_x[sizeof(_l_x) - 2] = block_deepth_char; - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 DEL "); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)_l_x); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"\n"); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 DEL "); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)_l_x); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"\n"); } /* return when exit method */ if (strEqu(block_type, "def")) { - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, - block_type_num + 1); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 RET \n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num + 1); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 RET \n"); } /* return when exit class */ if (strEqu(block_type, "class")) { - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, - block_type_num + 1); - pikaAsm = - strsAppend(outBuffs, pikaAsm, (char*)"0 RAS $origin\n"); - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, 1); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 NEW self\n"); - pikaAsm = strsAppend(outBuffs, pikaAsm, (char*)"0 RET \n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, + block_type_num + 1); + sPikaAsm = + strsAppend(outBuffs, sPikaAsm, (char*)"0 RAS $origin\n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, 1); + sPikaAsm = + strsAppend(outBuffs, sPikaAsm, (char*)"0 NEW self\n"); + sPikaAsm = strsAppend(outBuffs, sPikaAsm, (char*)"0 RET \n"); } } } /* add block deepth */ /* example: B0 */ - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, 0); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, 0); /* "deepth" is invoke deepth, not the blockDeepth */ - obj_setInt(ast, "deepth", 0); + obj_setInt(oAST, "deepth", 0); /* match block */ is_block_matched = 0; - if (strEqu(AST_getThisBlock(ast), "for")) { + if (strEqu(AST_getThisBlock(oAST), "for")) { /* for "for" iter */ - char* arg_in = obj_getStr(ast, "arg_in"); + char* arg_in = obj_getStr(oAST, "arg_in"); #if !PIKA_NANO_ENABLE char* arg_in_kv = NULL; #endif Arg* newAsm_arg = arg_newStr(""); char _l_x[] = "$lx"; char block_deepth_char = '0'; - block_deepth_char += AST_getBlockDeepthNow(ast); + block_deepth_char += AST_getBlockDeepthNow(oAST); _l_x[sizeof(_l_x) - 2] = block_deepth_char; /* init iter */ /* get the iter(_l) */ - pikaAsm = AST_genAsm_sub(ast, ast, &buffs, pikaAsm); + sPikaAsm = AST_genAsm_sub(oAST, oAST, &buffs, sPikaAsm); newAsm_arg = arg_strAppend(newAsm_arg, "0 OUT "); newAsm_arg = arg_strAppend(newAsm_arg, _l_x); newAsm_arg = arg_strAppend(newAsm_arg, "\n"); - pikaAsm = strsAppend(&buffs, pikaAsm, arg_getStr(newAsm_arg)); + sPikaAsm = strsAppend(&buffs, sPikaAsm, arg_getStr(newAsm_arg)); arg_deinit(newAsm_arg); newAsm_arg = arg_newStr(""); /* get next */ @@ -2912,7 +2945,7 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { } #endif - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, 0); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, 0); newAsm_arg = arg_strAppend(newAsm_arg, "0 RUN "); newAsm_arg = arg_strAppend(newAsm_arg, _l_x); newAsm_arg = arg_strAppend(newAsm_arg, @@ -2924,7 +2957,7 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { "0 EST "); newAsm_arg = arg_strAppend(newAsm_arg, arg_in); newAsm_arg = arg_strAppend(newAsm_arg, "\n0 JEZ 2\n"); - pikaAsm = strsAppend(&buffs, pikaAsm, arg_getStr(newAsm_arg)); + sPikaAsm = strsAppend(&buffs, sPikaAsm, arg_getStr(newAsm_arg)); arg_deinit(newAsm_arg); #if !PIKA_NANO_ENABLE @@ -2939,55 +2972,56 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { "%s = $tmp[%d]\n", item, out_num); AST* ast_this = AST_parseLine_withBlockDeepth( - stmt, AST_getBlockDeepthNow(ast) + 1); - pikaAsm = - strsAppend(&buffs, pikaAsm, AST_genAsm(ast_this, &buffs)); + stmt, AST_getBlockDeepthNow(oAST) + 1); + sPikaAsm = + strsAppend(&buffs, sPikaAsm, AST_genAsm(ast_this, &buffs)); AST_deinit(ast_this); out_num++; } - pikaAsm = ASM_addBlockDeepth(ast, outBuffs, pikaAsm, 1); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 DEL $tmp\n"); + sPikaAsm = ASM_addBlockDeepth(oAST, outBuffs, sPikaAsm, 1); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 DEL $tmp\n"); } #endif is_block_matched = 1; goto exit; } - if (strEqu(AST_getThisBlock(ast), "elif")) { + if (strEqu(AST_getThisBlock(oAST), "elif")) { /* skip if __else is 0 */ - pikaAsm = strsAppend(&buffs, pikaAsm, "0 NEL 1\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 NEL 1\n"); /* parse stmt ast */ - pikaAsm = AST_genAsm_sub(ast, ast, &buffs, pikaAsm); + sPikaAsm = AST_genAsm_sub(oAST, oAST, &buffs, sPikaAsm); /* skip if stmt is 0 */ - pikaAsm = strsAppend(&buffs, pikaAsm, "0 JEZ 1\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 JEZ 1\n"); is_block_matched = 1; goto exit; } - if (strEqu(AST_getThisBlock(ast), "def")) { + if (strEqu(AST_getThisBlock(oAST), "def")) { #if !PIKA_NANO_ENABLE - char* defaultStmts = AST_getNodeAttr(ast, "default"); + char* sDefaultStmts = AST_getNodeAttr(oAST, "default"); #endif - pikaAsm = strsAppend(&buffs, pikaAsm, "0 DEF "); - pikaAsm = strsAppend(&buffs, pikaAsm, AST_getNodeAttr(ast, "declare")); - pikaAsm = strsAppend(&buffs, pikaAsm, - "\n" - "0 JMP 1\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 DEF "); + sPikaAsm = + strsAppend(&buffs, sPikaAsm, AST_getNodeAttr(oAST, "declare")); + sPikaAsm = strsAppend(&buffs, sPikaAsm, + "\n" + "0 JMP 1\n"); #if !PIKA_NANO_ENABLE - if (NULL != defaultStmts) { - int stmt_num = strGetTokenNum(defaultStmts, ','); - for (int i = 0; i < stmt_num; i++) { - char* stmt = strsPopToken(&buffs, &defaultStmts, ','); - char* arg_name = strsGetFirstToken(&buffs, stmt, '='); - pikaAsm = ASM_addBlockDeepth(ast, &buffs, pikaAsm, 1); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 EST "); - pikaAsm = strsAppend(&buffs, pikaAsm, arg_name); - pikaAsm = strsAppend(&buffs, pikaAsm, "\n"); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 JNZ 2\n"); + if (NULL != sDefaultStmts) { + int iStmtNum = strGetTokenNum(sDefaultStmts, ','); + for (int i = 0; i < iStmtNum; i++) { + char* sStmt = Cursor_popToken(&buffs, &sDefaultStmts, ","); + char* sArgName = strsGetFirstToken(&buffs, sStmt, '='); + sPikaAsm = ASM_addBlockDeepth(oAST, &buffs, sPikaAsm, 1); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 EST "); + sPikaAsm = strsAppend(&buffs, sPikaAsm, sArgName); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 JNZ 2\n"); AST* ast_this = AST_parseLine_withBlockDeepth( - stmt, AST_getBlockDeepthNow(ast) + 1); - pikaAsm = - strsAppend(&buffs, pikaAsm, AST_genAsm(ast_this, &buffs)); + sStmt, AST_getBlockDeepthNow(oAST) + 1); + sPikaAsm = + strsAppend(&buffs, sPikaAsm, AST_genAsm(ast_this, &buffs)); AST_deinit(ast_this); } } @@ -2997,8 +3031,8 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { goto exit; } - if (strEqu(AST_getThisBlock(ast), "class")) { - char* declare = obj_getStr(ast, "declare"); + if (strEqu(AST_getThisBlock(oAST), "class")) { + char* declare = obj_getStr(oAST, "declare"); char* thisClass = NULL; char* superClass = NULL; if (strIsContain(declare, '(')) { @@ -3016,29 +3050,29 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { /* default superClass */ superClass = "TinyObj"; } - pikaAsm = strsAppend(&buffs, pikaAsm, "0 CLS "); - pikaAsm = strsAppend(&buffs, pikaAsm, - strsAppend(&buffs, thisClass, - "()\n" - "0 JMP 1\n")); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 CLS "); + sPikaAsm = strsAppend(&buffs, sPikaAsm, + strsAppend(&buffs, thisClass, + "()\n" + "0 JMP 1\n")); char block_deepth_str[] = "B0\n"; /* goto deeper block */ - block_deepth_str[1] += AST_getBlockDeepthNow(ast) + 1; - pikaAsm = strsAppend(&buffs, pikaAsm, block_deepth_str); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 RUN "); - pikaAsm = strsAppend(&buffs, pikaAsm, superClass); - pikaAsm = strsAppend(&buffs, pikaAsm, "\n"); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 OUT self\n"); - pikaAsm = strsAppend(&buffs, pikaAsm, block_deepth_str); - pikaAsm = strsAppend(&buffs, pikaAsm, "0 RAS self\n"); + block_deepth_str[1] += AST_getBlockDeepthNow(oAST) + 1; + sPikaAsm = strsAppend(&buffs, sPikaAsm, block_deepth_str); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 RUN "); + sPikaAsm = strsAppend(&buffs, sPikaAsm, superClass); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 OUT self\n"); + sPikaAsm = strsAppend(&buffs, sPikaAsm, block_deepth_str); + sPikaAsm = strsAppend(&buffs, sPikaAsm, "0 RAS self\n"); is_block_matched = 1; goto exit; } for (size_t i = 0; i < sizeof(rules_block) / sizeof(GenRule); i++) { GenRule rule = rules_block[i]; - if (strEqu(AST_getThisBlock(ast), rule.ast)) { - pikaAsm = GenRule_toAsm(rule, &buffs, ast, pikaAsm, 0); + if (strEqu(AST_getThisBlock(oAST), rule.ast)) { + sPikaAsm = GenRule_toAsm(rule, &buffs, oAST, sPikaAsm, 0); is_block_matched = 1; goto exit; } @@ -3048,26 +3082,26 @@ char* AST_genAsm(AST* ast, Args* outBuffs) { for (size_t i = 0; i < sizeof(rules_topAst) / sizeof(rules_topAst[0]); i++) { GenRule item = rules_topAst[i]; - if (obj_isArgExist(ast, item.ast)) { - pikaAsm = GenRule_toAsm(item, &buffs, ast, pikaAsm, 0); + if (obj_isArgExist(oAST, item.ast)) { + sPikaAsm = GenRule_toAsm(item, &buffs, oAST, sPikaAsm, 0); is_block_matched = 1; goto exit; } } exit: - if (NULL == pikaAsm) { + if (NULL == sPikaAsm) { strsDeinit(&buffs); return NULL; } if (!is_block_matched) { /* parse stmt ast */ - pikaAsm = AST_genAsm_sub(ast, ast, &buffs, pikaAsm); + sPikaAsm = AST_genAsm_sub(oAST, oAST, &buffs, sPikaAsm); } /* output pikaAsm */ - pikaAsm = strsCopy(outBuffs, pikaAsm); + sPikaAsm = strsCopy(outBuffs, sPikaAsm); strsDeinit(&buffs); - return pikaAsm; + return sPikaAsm; } int32_t AST_deinit(AST* ast) { diff --git a/examples/pikapython/pikapython/pikascript-core/PikaParser.h b/examples/pikapython/pikapython/pikascript-core/PikaParser.h index aa227acc..b1e19811 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaParser.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaParser.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/PikaPlatform.c b/examples/pikapython/pikapython/pikascript-core/PikaPlatform.c index 4f961ac1..37017a54 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaPlatform.c +++ b/examples/pikapython/pikapython/pikascript-core/PikaPlatform.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -587,3 +587,7 @@ PIKA_WEAK void pika_platform_thread_timer_usleep(unsigned long usec) { PIKA_WEAK void pika_platform_reboot(void) { WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); } + +PIKA_WEAK void pika_platform_clear(void) { + WEAK_FUNCTION_NEED_OVERRIDE_ERROR(); +} diff --git a/examples/pikapython/pikapython/pikascript-core/PikaPlatform.h b/examples/pikapython/pikapython/pikascript-core/PikaPlatform.h index e2b5c8fb..8213d119 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaPlatform.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaPlatform.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -48,7 +48,7 @@ abort(); \ } #else - #define pika_assert(...) + #define pika_assert(...) (void)0; #endif /* clang-format on */ @@ -287,6 +287,7 @@ int pika_platform_thread_timer_remain(pika_platform_timer_t* timer); unsigned long pika_platform_thread_timer_now(void); void pika_platform_thread_timer_usleep(unsigned long usec); void pika_platform_reboot(void); +void pika_platform_clear(void); #define WEAK_FUNCTION_NEED_OVERRIDE_ERROR(_) \ pika_platform_printf("Error: weak function `%s()` need override.\r\n", \ diff --git a/examples/pikapython/pikapython/pikascript-core/PikaVM.c b/examples/pikapython/pikapython/pikascript-core/PikaVM.c index cab260eb..c6d336d0 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaVM.c +++ b/examples/pikapython/pikapython/pikascript-core/PikaVM.c @@ -1,6 +1,6 @@ -/* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript +/* + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -31,62 +31,81 @@ #include "PikaObj.h" #include "PikaParser.h" #include "PikaPlatform.h" +#include "dataArg.h" #include "dataStrs.h" #if PIKA_MATH_ENABLE #include #endif -volatile VMSignal PikaVMSignal = {.signal_ctrl = VM_SIGNAL_CTRL_NONE, - .vm_cnt = 0, +static pika_platform_thread_mutex_t g_pikaGIL = {0}; +volatile VMSignal g_PikaVMSignal = {.signal_ctrl = VM_SIGNAL_CTRL_NONE, + + .vm_cnt = 0, #if PIKA_EVENT_ENABLE - .cq = - { - .head = 0, - .tail = 0, - .res = {0}, - } + .cq = + { + .head = 0, + .tail = 0, + .res = {0}, + }, + .event_pickup_cnt = 0, + .event_thread_inited = 0 + #endif }; +extern volatile PikaObjState g_PikaObjState; -static pika_platform_thread_mutex_t pikavm_global_lock = {0}; +/* private */ +static PIKA_BOOL _checkLReg(char* data); +static uint8_t _getLRegIndex(char* data); +static PikaObj* New_Locals(Args* args); +char* string_slice(Args* outBuffs, char* str, int start, int end); int pika_GIL_ENTER(void) { - if (!pikavm_global_lock.is_init) { + if (!g_pikaGIL.is_init) { return 0; } - int ret = pika_platform_thread_mutex_lock(&pikavm_global_lock); - pika_debug("pika_GIL_ENTER"); - if (!pikavm_global_lock.is_first_lock) { - pikavm_global_lock.is_first_lock = 1; + int ret = pika_platform_thread_mutex_lock(&g_pikaGIL); + // pika_debug("pika_GIL_ENTER"); + if (!g_pikaGIL.is_first_lock) { + g_pikaGIL.is_first_lock = 1; } return ret; } int pika_GIL_EXIT(void) { - if (!pikavm_global_lock.is_init) { + if (!g_pikaGIL.is_init) { return 0; } - pika_debug("pika_GIL_EXIT"); - return pika_platform_thread_mutex_unlock(&pikavm_global_lock); + // pika_debug("pika_GIL_EXIT"); + return pika_platform_thread_mutex_unlock(&g_pikaGIL); } int _VM_lock_init(void) { - if (pikavm_global_lock.is_init) { + if (g_pikaGIL.is_init) { return 0; } - int ret = pika_platform_thread_mutex_init(&pikavm_global_lock); + int ret = pika_platform_thread_mutex_init(&g_pikaGIL); if (0 == ret) { - pikavm_global_lock.is_init = 1; + g_pikaGIL.is_init = 1; } return ret; } int _VM_is_first_lock(void) { - return pikavm_global_lock.is_first_lock; + return g_pikaGIL.is_first_lock; } int _VMEvent_getVMCnt(void) { - return PikaVMSignal.vm_cnt; + return g_PikaVMSignal.vm_cnt; +} + +int _VMEvent_getEventPickupCnt(void) { +#if !PIKA_EVENT_ENABLE + return -1; +#else + return g_PikaVMSignal.event_pickup_cnt; +#endif } #if PIKA_EVENT_ENABLE @@ -160,13 +179,13 @@ void _VMEvent_deinit(void) { pika_platform_panic_handle(); #else for (int i = 0; i < PIKA_EVENT_LIST_SIZE; i++) { - if (NULL != PikaVMSignal.cq.res[i]) { - arg_deinit(PikaVMSignal.cq.res[i]); - PikaVMSignal.cq.res[i] = NULL; + if (NULL != g_PikaVMSignal.cq.res[i]) { + arg_deinit(g_PikaVMSignal.cq.res[i]); + g_PikaVMSignal.cq.res[i] = NULL; } - if (NULL != PikaVMSignal.cq.data[i]) { - arg_deinit(PikaVMSignal.cq.data[i]); - PikaVMSignal.cq.data[i] = NULL; + if (NULL != g_PikaVMSignal.cq.data[i]) { + arg_deinit(g_PikaVMSignal.cq.data[i]); + g_PikaVMSignal.cq.data[i] = NULL; } } #endif @@ -178,27 +197,29 @@ PIKA_RES __eventListener_pushEvent(PikaEventListener* lisener, #if !PIKA_EVENT_ENABLE pika_platform_printf("PIKA_EVENT_ENABLE is not enable"); pika_platform_panic_handle(); + return PIKA_RES_ERR_OPERATION_FAILED; #else /* push to event_cq_buff */ - if (_ecq_isFull(&PikaVMSignal.cq)) { + if (_ecq_isFull(&g_PikaVMSignal.cq)) { arg_deinit(eventData); return PIKA_RES_ERR_SIGNAL_EVENT_FULL; } if (arg_getType(eventData) == ARG_TYPE_OBJECT_NEW) { arg_setType(eventData, ARG_TYPE_OBJECT); } - if (PikaVMSignal.cq.res[PikaVMSignal.cq.tail] != NULL) { - arg_deinit(PikaVMSignal.cq.res[PikaVMSignal.cq.tail]); - PikaVMSignal.cq.res[PikaVMSignal.cq.tail] = NULL; + if (g_PikaVMSignal.cq.res[g_PikaVMSignal.cq.tail] != NULL) { + arg_deinit(g_PikaVMSignal.cq.res[g_PikaVMSignal.cq.tail]); + g_PikaVMSignal.cq.res[g_PikaVMSignal.cq.tail] = NULL; } - if (PikaVMSignal.cq.data[PikaVMSignal.cq.tail] != NULL) { - arg_deinit(PikaVMSignal.cq.data[PikaVMSignal.cq.tail]); - PikaVMSignal.cq.data[PikaVMSignal.cq.tail] = NULL; + if (g_PikaVMSignal.cq.data[g_PikaVMSignal.cq.tail] != NULL) { + arg_deinit(g_PikaVMSignal.cq.data[g_PikaVMSignal.cq.tail]); + g_PikaVMSignal.cq.data[g_PikaVMSignal.cq.tail] = NULL; } - PikaVMSignal.cq.id[PikaVMSignal.cq.tail] = eventId; - PikaVMSignal.cq.data[PikaVMSignal.cq.tail] = eventData; - PikaVMSignal.cq.lisener[PikaVMSignal.cq.tail] = lisener; - PikaVMSignal.cq.tail = (PikaVMSignal.cq.tail + 1) % PIKA_EVENT_LIST_SIZE; + g_PikaVMSignal.cq.id[g_PikaVMSignal.cq.tail] = eventId; + g_PikaVMSignal.cq.data[g_PikaVMSignal.cq.tail] = eventData; + g_PikaVMSignal.cq.lisener[g_PikaVMSignal.cq.tail] = lisener; + g_PikaVMSignal.cq.tail = + (g_PikaVMSignal.cq.tail + 1) % PIKA_EVENT_LIST_SIZE; return PIKA_RES_OK; #endif } @@ -210,16 +231,18 @@ PIKA_RES __eventListener_popEvent(PikaEventListener** lisener_p, #if !PIKA_EVENT_ENABLE pika_platform_printf("PIKA_EVENT_ENABLE is not enable"); pika_platform_panic_handle(); + return PIKA_RES_ERR_OPERATION_FAILED; #else /* pop from event_cq_buff */ - if (_ecq_isEmpty(&PikaVMSignal.cq)) { + if (_ecq_isEmpty(&g_PikaVMSignal.cq)) { return PIKA_RES_ERR_SIGNAL_EVENT_EMPTY; } - *id = PikaVMSignal.cq.id[PikaVMSignal.cq.head]; - *data = PikaVMSignal.cq.data[PikaVMSignal.cq.head]; - *lisener_p = PikaVMSignal.cq.lisener[PikaVMSignal.cq.head]; - *head = PikaVMSignal.cq.head; - PikaVMSignal.cq.head = (PikaVMSignal.cq.head + 1) % PIKA_EVENT_LIST_SIZE; + *id = g_PikaVMSignal.cq.id[g_PikaVMSignal.cq.head]; + *data = g_PikaVMSignal.cq.data[g_PikaVMSignal.cq.head]; + *lisener_p = g_PikaVMSignal.cq.lisener[g_PikaVMSignal.cq.head]; + *head = g_PikaVMSignal.cq.head; + g_PikaVMSignal.cq.head = + (g_PikaVMSignal.cq.head + 1) % PIKA_EVENT_LIST_SIZE; return PIKA_RES_OK; #endif } @@ -229,34 +252,41 @@ void _VMEvent_pickupEvent(void) { pika_platform_printf("PIKA_EVENT_ENABLE is not enable\r\n"); pika_platform_panic_handle(); #else + int evt_pickup_cnt = _VMEvent_getEventPickupCnt(); + if (evt_pickup_cnt >= PIKA_EVENT_PICKUP_MAX) { + return; + } PikaObj* event_lisener; uint32_t event_id; Arg* event_data; int head; if (PIKA_RES_OK == __eventListener_popEvent(&event_lisener, &event_id, &event_data, &head)) { + g_PikaVMSignal.event_pickup_cnt++; + pika_debug("pickup_cnt: %d", g_PikaVMSignal.event_pickup_cnt); Arg* res = __eventListener_runEvent(event_lisener, event_id, event_data); - PikaVMSignal.cq.res[head] = res; + g_PikaVMSignal.cq.res[head] = res; + g_PikaVMSignal.event_pickup_cnt--; } #endif } VM_SIGNAL_CTRL VMSignal_getCtrl(void) { - return PikaVMSignal.signal_ctrl; + return g_PikaVMSignal.signal_ctrl; } void pks_vm_exit(void) { - PikaVMSignal.signal_ctrl = VM_SIGNAL_CTRL_EXIT; + g_PikaVMSignal.signal_ctrl = VM_SIGNAL_CTRL_EXIT; } void pks_vmSignal_setCtrlElear(void) { - PikaVMSignal.signal_ctrl = VM_SIGNAL_CTRL_NONE; + g_PikaVMSignal.signal_ctrl = VM_SIGNAL_CTRL_NONE; } /* head declare start */ static uint8_t VMState_getInputArgNum(VMState* vm); -static VMParameters* __pikaVM_runByteCodeFrameWithState( +static VMParameters* _pikaVM_runByteCodeFrameWithState( PikaObj* self, VMParameters* locals, VMParameters* globals, @@ -270,9 +300,9 @@ static void VMState_setErrorCode(VMState* vm, int8_t error_code) { vm->error_code = error_code; } -static enum Instruct VMstate_getInstructWithOffset(VMState* vm, - int32_t offset) { - return instructUnit_getInstruct( +static enum InstructIndex VMstate_getInstructWithOffset(VMState* vm, + int32_t offset) { + return instructUnit_getInstructIndex( VMState_getInstructUnitWithOffset(vm, offset)); } @@ -306,12 +336,13 @@ static int32_t VMState_getAddrOffsetOfJmpBack(VMState* vm) { InstructUnit* insUnitThis = VMState_getInstructUnitWithOffset(vm, offset); uint16_t invokeDeepth = instructUnit_getInvokeDeepth(insUnitThis); - enum Instruct ins = instructUnit_getInstruct(insUnitThis); + enum InstructIndex ins = instructUnit_getInstructIndex(insUnitThis); char* data = VMState_getConstWithInstructUnit(vm, insUnitThis); if ((0 == invokeDeepth) && (JEZ == ins) && data[0] == '2') { InstructUnit* insUnitLast = VMState_getInstructUnitWithOffset( vm, offset - instructUnit_getSize()); - enum Instruct insLast = instructUnit_getInstruct(insUnitLast); + enum InstructIndex insLast = + instructUnit_getInstructIndex(insUnitLast); /* skip try stmt */ if (GER == insLast) { continue; @@ -331,7 +362,7 @@ static int32_t VMState_getAddrOffsetOfJmpBack(VMState* vm) { offset += instructUnit_getSize(); InstructUnit* insUnitThis = VMState_getInstructUnitWithOffset(vm, offset); - enum Instruct ins = instructUnit_getInstruct(insUnitThis); + enum InstructIndex ins = instructUnit_getInstructIndex(insUnitThis); char* data = VMState_getConstWithInstructUnit(vm, insUnitThis); int blockDeepthThis = instructUnit_getBlockDeepth(insUnitThis); if ((blockDeepthThis == blockDeepthGot) && (JMP == ins) && @@ -405,7 +436,7 @@ static int32_t VMState_getAddrOffsetOfRaise(VMState* vm) { return 0; } ins_unit_now = VMState_getInstructUnitWithOffset(vm, offset); - enum Instruct ins = instructUnit_getInstruct(ins_unit_now); + enum InstructIndex ins = instructUnit_getInstructIndex(ins_unit_now); if (NTR == ins) { return offset; } @@ -423,21 +454,91 @@ static int32_t VMState_getAddrOffsetOfContinue(VMState* vm) { return offset; } -static void VMState_delLReg(VMState* vm, uint8_t index) { - PikaObj* obj = vm->lreg[index]; +static void VMLocals_delLReg(VMLocals* self, uint8_t index) { + PikaObj* obj = self->lreg[index]; if (NULL != obj) { - obj_refcntDec(obj); - vm->lreg[index] = NULL; - if (0 == obj_refcntNow(obj)) { - obj_deinit(obj); - } + obj_enableGC(obj); + self->lreg[index] = NULL; + obj_GC(obj); } } -static void VMState_initReg(VMState* vm) { +static void Locals_delLReg(PikaObj* self, char* name) { + if (!_checkLReg(name)) { + return; + } + uint8_t reg_index = _getLRegIndex(name); + VMLocals* locals = obj_getStruct(self, "@l"); + VMLocals_delLReg(locals, reg_index); +} + +static void VMLocals_clearReg(VMLocals* self) { + for (int i = 0; i < PIKA_REGIST_SIZE; i++) { + VMLocals_delLReg(self, i); + } +} + +static PikaObj* Locals_getLReg(PikaObj* self, char* name) { + /* get method host obj from reg */ + if (!_checkLReg(name)) { + return NULL; + } + uint8_t reg_index = _getLRegIndex(name); + VMLocals* locals = obj_getStruct(self, "@l"); + return locals->lreg[reg_index]; +} + +static PikaObj* New_Locals(Args* args) { + PikaObj* self = New_PikaObj(); + self->constructor = New_Locals; +#if PIKA_KERNAL_DEBUG_ENABLE + self->name = "Locals"; +#endif + return self; +} + +void Locals_deinit(PikaObj* self) { + VMLocals* tLocals = obj_getStruct(self, "@l"); + if (NULL == tLocals) { + return; + } + VMLocals_clearReg(tLocals); +} + +static int _obj_getLen(PikaObj* self) { + PIKA_PYTHON(@l = __len__()) + /* clang-format on */ + const uint8_t bytes[] = { + 0x08, 0x00, 0x00, 0x00, /* instruct array size */ + 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x09, 0x00, /* instruct + array */ + 0x0c, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x5f, 0x5f, 0x6c, 0x65, 0x6e, 0x5f, 0x5f, 0x00, + 0x40, 0x6c, 0x00, /* const pool */ + }; + pikaVM_runByteCode(self, bytes); + int len = obj_getInt(self, "@l"); + obj_removeArg(self, "@l"); + return len; +} + +static int arg_getLen(Arg* self) { + if (arg_isObject(self)) { + return _obj_getLen(arg_getPtr(self)); + } + if (arg_getType(self) == ARG_TYPE_STRING) { + int strGetSizeUtf8(char* str); + return strGetSizeUtf8(arg_getStr(self)); + } + if (arg_getType(self) == ARG_TYPE_BYTES) { + return arg_getBytesSize(self); + } + return -1; +} + +static void VMState_initReg(VMState* self) { for (uint8_t i = 0; i < PIKA_REGIST_SIZE; i++) { - vm->lreg[i] = NULL; - vm->ireg[i] = PIKA_FALSE; + self->ireg[i] = PIKA_FALSE; } } @@ -453,15 +554,27 @@ static uint8_t _getLRegIndex(char* data) { return data[2] - '0'; } -static void VMState_setLReg(VMState* vm, uint8_t index, PikaObj* obj) { +static void VMLocals_setLReg(VMLocals* self, uint8_t index, PikaObj* obj) { obj_refcntInc(obj); - vm->lreg[index] = obj; + self->lreg[index] = obj; } -typedef Arg* (*VM_instruct_handler)(PikaObj* self, - VMState* vm, - char* data, - Arg* arg_ret_reg); +static void Locals_setLReg(PikaObj* self, char* name, PikaObj* obj) { + if (!_checkLReg(name)) { + return; + } + uint8_t reg_index = _getLRegIndex(name); + VMLocals* tlocals = obj_getStruct(self, "@l"); + if (NULL == tlocals) { + /* init locals */ + VMLocals locals = {0}; + obj_setStruct(self, "@l", locals); + tlocals = obj_getStruct(self, "@l"); + } + pika_assert(tlocals != NULL); + obj_setName(obj, name); + VMLocals_setLReg(tlocals, reg_index, obj); +} static Arg* VM_instruction_handler_NON(PikaObj* self, VMState* vm, @@ -470,49 +583,59 @@ static Arg* VM_instruction_handler_NON(PikaObj* self, return NULL; } -Arg* __vm_get(VMState* vm, PikaObj* self, Arg* key, Arg* obj) { - ArgType type = arg_getType(obj); - Arg* obj_new = NULL; - int index = 0; - if (ARG_TYPE_INT == arg_getType(key)) { - index = arg_getInt(key); +Arg* _vm_get(VMState* vm, PikaObj* self, Arg* aKey, Arg* aObj) { + ArgType eType = arg_getType(aObj); + Arg* aObjNew = NULL; + int iIndex = 0; + int iLen = arg_getLen(aObj); + if (ARG_TYPE_INT == arg_getType(aKey)) { + iIndex = arg_getInt(aKey); } - if (ARG_TYPE_STRING == type) { + + if (iIndex < 0) { + iIndex += iLen; + arg_setInt(aKey, "", iIndex); + } + + if (iIndex >= iLen) { + VMState_setErrorCode(vm, PIKA_RES_ERR_OUT_OF_RANGE); + pika_platform_printf("IndexError: index out of range\r\n"); + return arg_newNull(); + } + + if (ARG_TYPE_STRING == eType) { #if PIKA_STRING_UTF8_ENABLE - PIKA_BOOL is_temp = PIKA_FALSE; - obj_new = arg_newObj(_arg_to_obj(obj, &is_temp)); - type = arg_getType(obj_new); + PIKA_BOOL bIsTemp = PIKA_FALSE; + aObjNew = arg_newObj(_arg_to_obj(aObj, &bIsTemp)); + eType = arg_getType(aObjNew); #else - char* str_pyload = arg_getStr(obj); - char char_buff[] = " "; - if (index < 0) { - index = strGetSize(str_pyload) + index; + char* sPyload = arg_getStr(aObj); + char sCharBuff[] = " "; + if (iIndex < 0) { + iIndex = strGetSize(sPyload) + iIndex; } - char_buff[0] = str_pyload[index]; - return arg_newStr(char_buff); + sCharBuff[0] = sPyload[iIndex]; + return arg_newStr(sCharBuff); #endif } - if (ARG_TYPE_BYTES == type) { - uint8_t* bytes_pyload = arg_getBytes(obj); - uint8_t byte_buff[] = " "; - if (index < 0) { - index = arg_getBytesSize(obj) + index; - } - byte_buff[0] = bytes_pyload[index]; - return arg_newBytes(byte_buff, 1); + if (ARG_TYPE_BYTES == eType) { + uint8_t* sBytesPyload = arg_getBytes(aObj); + uint8_t sByteBuff[] = " "; + sByteBuff[0] = sBytesPyload[iIndex]; + return arg_newBytes(sByteBuff, 1); } - if (argType_isObject(type)) { - PikaObj* arg_obj = NULL; - if (obj_new != NULL) { - arg_obj = arg_getPtr(obj_new); + if (argType_isObject(eType)) { + PikaObj* oArg = NULL; + Arg* aRes = NULL; + if (aObjNew != NULL) { + oArg = arg_getPtr(aObjNew); } else { - arg_obj = arg_getPtr(obj); + oArg = arg_getPtr(aObj); } - obj_setArg(arg_obj, "__key", key); - obj_removeArg(arg_obj, "__res"); + obj_setArg(oArg, "__key", aKey); /* clang-format off */ PIKA_PYTHON( - __res = __getitem__(__key) + @res_item = __getitem__(__key) ) /* clang-format on */ const uint8_t bytes[] = { @@ -520,125 +643,130 @@ Arg* __vm_get(VMState* vm, PikaObj* self, Arg* key, Arg* obj) { 0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, 0x04, 0x13, 0x00, /* instruct array */ - 0x19, 0x00, 0x00, 0x00, /* const pool size */ + 0x1d, 0x00, 0x00, 0x00, /* const pool size */ 0x00, 0x5f, 0x5f, 0x6b, 0x65, 0x79, 0x00, 0x5f, 0x5f, 0x67, 0x65, - 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, - 0x65, 0x73, 0x00, - /* const pool */ + 0x74, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x5f, 0x00, 0x40, 0x72, 0x65, + 0x73, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x00, /* const pool */ }; if (NULL != vm) { - _do_pikaVM_runByteCode(arg_obj, arg_obj, arg_obj, (uint8_t*)bytes, - vm->run_state, PIKA_TRUE); + aRes = _do_pikaVM_runByteCodeReturn(oArg, oArg, oArg, + (uint8_t*)bytes, vm->run_state, + PIKA_TRUE, "@res_item"); } else { - pikaVM_runByteCode(arg_obj, (uint8_t*)bytes); + aRes = pikaVM_runByteCodeReturn(oArg, (uint8_t*)bytes, "@res_item"); } - Arg* __res = args_getArg(arg_obj->list, "__res"); - Arg* res = NULL; - if (NULL != __res) { - res = arg_copy(__res); + if (NULL != aObjNew) { + arg_deinit(aObjNew); } - if (NULL != obj_new) { - arg_deinit(obj_new); - } - if (NULL == res) { + if (NULL == aRes) { if (NULL != vm) { VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); } return arg_newNull(); } - return res; + return aRes; } return arg_newNull(); } Arg* _vm_slice(VMState* vm, PikaObj* self, - Arg* end, - Arg* obj, - Arg* start, + Arg* aEnd, + Arg* aObj, + Arg* aStart, int step) { #if PIKA_SYNTAX_SLICE_ENABLE /* No interger index only support __getitem__ */ - if (!(arg_getType(start) == ARG_TYPE_INT && - arg_getType(end) == ARG_TYPE_INT)) { - return __vm_get(vm, self, start, obj); + if (!(arg_getType(aStart) == ARG_TYPE_INT && + arg_getType(aEnd) == ARG_TYPE_INT)) { + return _vm_get(vm, self, aStart, aObj); + } + int iLen = arg_getLen(aObj); + int iStart = arg_getInt(aStart); + int iEnd = arg_getInt(aEnd); + + if (iStart < 0) { + iStart += iLen; + } + /* magic code, to the end */ + if (iEnd == VM_PC_EXIT) { + iEnd = iLen; + } + if (iEnd < 0) { + iEnd += iLen; } - int start_i = arg_getInt(start); - int end_i = arg_getInt(end); + if (iStart > iLen) { + iStart = iLen; + } + + if (iEnd > iLen) { + iEnd = iLen; + } + + if (iStart > iEnd) { + return arg_newStr(""); + } /* __slice__ is equal to __getitem__ */ - if (end_i - start_i == 1) { - return __vm_get(vm, self, start, obj); + if (iEnd - iStart == 1) { + return _vm_get(vm, self, aStart, aObj); } - if (ARG_TYPE_STRING == arg_getType(obj)) { - char* string_slice(Args * outBuffs, char* str, int start, int end); + if (ARG_TYPE_STRING == arg_getType(aObj)) { Args buffs = {0}; - Arg* sliced_arg = NULL; - char* sliced_str = - string_slice(&buffs, arg_getStr(obj), start_i, end_i); - if (NULL != sliced_str) { - sliced_arg = arg_newStr(sliced_str); + Arg* aSliced = NULL; + char* sSliced = string_slice(&buffs, arg_getStr(aObj), iStart, iEnd); + if (NULL != sSliced) { + aSliced = arg_newStr(sSliced); } else { - sliced_arg = arg_newNull(); + aSliced = arg_newNull(); } strsDeinit(&buffs); - return sliced_arg; + return aSliced; } - if (ARG_TYPE_BYTES == arg_getType(obj)) { - size_t len = arg_getBytesSize(obj); - if (start_i < 0) { - start_i += len; + if (ARG_TYPE_BYTES == arg_getType(aObj)) { + Arg* aSliced = arg_newBytes(NULL, 0); + for (int i = iStart; i < iEnd; i++) { + Arg* aIndex = arg_newInt(i); + Arg* aItem = _vm_get(vm, self, aIndex, aObj); + uint8_t* sBytesOrigin = arg_getBytes(aSliced); + size_t uSizeOrigin = arg_getBytesSize(aSliced); + Arg* aSlicedNew = arg_newBytes(NULL, uSizeOrigin + 1); + pika_platform_memcpy(arg_getBytes(aSlicedNew), sBytesOrigin, + uSizeOrigin); + pika_platform_memcpy(arg_getBytes(aSlicedNew) + uSizeOrigin, + arg_getBytes(aItem), 1); + arg_deinit(aSliced); + aSliced = aSlicedNew; + arg_deinit(aItem); + arg_deinit(aIndex); } - /* megic code, to the end */ - if (end_i == VM_PC_EXIT) { - end_i = len; - } - if (end_i < 0) { - end_i += len; - } - Arg* sliced_arg = arg_newBytes(NULL, 0); - for (int i = start_i; i < end_i; i++) { - Arg* i_arg = arg_newInt(i); - Arg* item_arg = __vm_get(vm, self, i_arg, obj); - uint8_t* bytes_origin = arg_getBytes(sliced_arg); - size_t size_origin = arg_getBytesSize(sliced_arg); - Arg* sliced_arg_new = arg_newBytes(NULL, size_origin + 1); - pika_platform_memcpy(arg_getBytes(sliced_arg_new), bytes_origin, - size_origin); - pika_platform_memcpy(arg_getBytes(sliced_arg_new) + size_origin, - arg_getBytes(item_arg), 1); - arg_deinit(sliced_arg); - sliced_arg = sliced_arg_new; - arg_deinit(item_arg); - arg_deinit(i_arg); - } - return sliced_arg; + return aSliced; } - if (argType_isObject(arg_getType(obj))) { - PikaObj* arg_obj = arg_getPtr(obj); + if (arg_isObject(aObj)) { + PikaObj* oArg = arg_getPtr(aObj); PikaObj* New_PikaStdData_List(Args * args); PikaObj* New_PikaStdData_Tuple(Args * args); - if (arg_obj->constructor == New_PikaStdData_List || - arg_obj->constructor == New_PikaStdData_Tuple) { - PikaObj* sliced_obj = newNormalObj((NewFun)arg_obj->constructor); - __vm_List___init__(sliced_obj); - for (int i = start_i; i < end_i; i++) { - Arg* i_arg = arg_newInt(i); - Arg* item_arg = __vm_get(vm, self, i_arg, obj); - __vm_List_append(sliced_obj, item_arg); - arg_deinit(item_arg); - arg_deinit(i_arg); + if (oArg->constructor == New_PikaStdData_List || + oArg->constructor == New_PikaStdData_Tuple) { + PikaObj* oSliced = newNormalObj((NewFun)oArg->constructor); + __vm_List___init__(oSliced); + for (int i = iStart; i < iEnd; i++) { + Arg* aIndex = arg_newInt(i); + Arg* aItem = _vm_get(vm, self, aIndex, aObj); + __vm_List_append(oSliced, aItem); + arg_deinit(aItem); + arg_deinit(aIndex); } - return arg_newObj(sliced_obj); + return arg_newObj(oSliced); } } return arg_newNull(); #else - return __vm_get(vm, self, start, obj); + return _vm_get(vm, self, aStart, aObj); #endif } @@ -654,7 +782,7 @@ static Arg* VM_instruction_handler_SLC(PikaObj* self, if (n_input == 2) { Arg* key = stack_popArg_alloc(&vm->stack); Arg* obj = stack_popArg_alloc(&vm->stack); - Arg* res = __vm_get(vm, self, key, obj); + Arg* res = _vm_get(vm, self, key, obj); arg_deinit(key); arg_deinit(obj); return res; @@ -673,7 +801,7 @@ static Arg* VM_instruction_handler_SLC(PikaObj* self, #else Arg* key = stack_popArg_alloc(&vm->stack); Arg* obj = stack_popArg_alloc(&vm->stack); - Arg* res = __vm_get(vm, self, key, obj); + Arg* res = _vm_get(vm, self, key, obj); arg_deinit(key); arg_deinit(obj); return res; @@ -773,8 +901,8 @@ static Arg* _proxy_getattr(PikaObj* host, char* name) { static Arg* VM_instruction_handler_REF(PikaObj* self, VMState* vm, char* data, - Arg* arg_ret_reg) { - PikaObj* host_obj = NULL; + Arg* aRetReg) { + PikaObj* oHost = NULL; char* arg_path = data; char* arg_name = strPointToLastToken(arg_path, '.'); PIKA_BOOL is_temp = PIKA_FALSE; @@ -782,98 +910,96 @@ static Arg* VM_instruction_handler_REF(PikaObj* self, switch (data[0]) { case 'T': if (strEqu(arg_path, (char*)"True")) { - return arg_setBool(arg_ret_reg, "", PIKA_TRUE); + return arg_setBool(aRetReg, "", PIKA_TRUE); } break; case 'F': if (strEqu(arg_path, (char*)"False")) { - return arg_setBool(arg_ret_reg, "", PIKA_FALSE); + return arg_setBool(aRetReg, "", PIKA_FALSE); } break; case 'N': if (strEqu(arg_path, (char*)"None")) { - return arg_setNull(arg_ret_reg); + return arg_setNull(aRetReg); } break; case 'R': if (strEqu(arg_path, (char*)"RuntimeError")) { - return arg_setInt(arg_ret_reg, "", PIKA_RES_ERR_RUNTIME_ERROR); + return arg_setInt(aRetReg, "", PIKA_RES_ERR_RUNTIME_ERROR); } break; } - Arg* res = NULL; + Arg* aRes = NULL; if (arg_path[0] == '.') { /* find host from stack */ Arg* host_arg = stack_popArg_alloc(&(vm->stack)); - if (argType_isObject(arg_getType(host_arg))) { - host_obj = arg_getPtr(host_arg); - res = arg_copy_noalloc(obj_getArg(host_obj, arg_path + 1), - arg_ret_reg); + if (arg_isObject(host_arg)) { + oHost = arg_getPtr(host_arg); + aRes = arg_copy_noalloc(obj_getArg(oHost, arg_path + 1), aRetReg); } arg_deinit(host_arg); goto exit; } /* find in local list first */ - if (NULL == host_obj) { - host_obj = obj_getHostObjWithIsTemp(vm->locals, arg_path, &is_temp); + if (NULL == oHost) { + oHost = obj_getHostObjWithIsTemp(vm->locals, arg_path, &is_temp); } /* find in global list */ - if (NULL == host_obj) { - host_obj = obj_getHostObjWithIsTemp(vm->globals, arg_path, &is_temp); + if (NULL == oHost) { + oHost = obj_getHostObjWithIsTemp(vm->globals, arg_path, &is_temp); } /* error cannot found host_object */ - if (NULL == host_obj) { + if (NULL == oHost) { goto exit; } /* proxy */ - if (NULL == res) { - res = _proxy_getattribute(host_obj, arg_name); + if (NULL == aRes) { + aRes = _proxy_getattribute(oHost, arg_name); } /* find res in host */ - if (NULL == res) { - res = args_getArg(host_obj->list, arg_name); + if (NULL == aRes) { + aRes = args_getArg(oHost->list, arg_name); } /* find res in host prop */ - if (NULL == res) { - res = _obj_getProp(host_obj, arg_name); + if (NULL == aRes) { + aRes = _obj_getProp(oHost, arg_name); } /* find res in globlas */ - if (NULL == res) { - res = args_getArg(vm->globals->list, arg_name); + if (NULL == aRes) { + aRes = args_getArg(vm->globals->list, arg_name); } /* find res in globals prop */ - if (NULL == res) { - res = _obj_getProp(vm->globals, arg_name); + if (NULL == aRes) { + aRes = _obj_getProp(vm->globals, arg_name); } /* proxy */ - if (NULL == res) { - res = _proxy_getattr(host_obj, arg_name); + if (NULL == aRes) { + aRes = _proxy_getattr(oHost, arg_name); } exit: - if (NULL == res) { + if (NULL == aRes) { VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); pika_platform_printf("NameError: name '%s' is not defined\r\n", arg_path); } else { - if (arg_getType(res) == ARG_TYPE_METHOD_OBJECT) { - methodArg_setHostObj(res, host_obj); - } - res = arg_copy_noalloc(res, arg_ret_reg); + methodArg_setHostObj(aRes, oHost); + aRes = arg_copy_noalloc(aRes, aRetReg); + pika_assert_arg_alive(aRes); } if (is_temp) { - obj_GC(host_obj); + obj_GC(oHost); } - return res; + return aRes; } static Arg* VM_instruction_handler_GER(PikaObj* self, @@ -893,53 +1019,63 @@ Arg* _get_return_arg(PikaObj* locals) { Arg* _obj_runMethodArgWithState(PikaObj* self, PikaObj* locals, - Arg* method_arg, + Arg* aMethod, RunState* run_state, - Arg* ret_arg_reg) { + Arg* aReturnCache) { pika_assert(NULL != run_state); - Arg* return_arg = NULL; + Arg* aReturn = NULL; /* get method Ptr */ - Method method_ptr = methodArg_getPtr(method_arg); + Method fMethod = methodArg_getPtr(aMethod); /* get method type list */ - ArgType method_type = arg_getType(method_arg); + ArgType methodType = arg_getType(aMethod); /* error */ - if (ARG_TYPE_NONE == method_type) { + if (ARG_TYPE_NONE == methodType) { return NULL; } - ByteCodeFrame* method_bytecodeFrame = - methodArg_getBytecodeFrame(method_arg); /* redirect to def context */ - if (!argType_isNative(method_type)) { - self = methodArg_getDefContext(method_arg); + if (!argType_isNative(methodType)) { + self = methodArg_getDefContext(aMethod); } obj_setErrorCode(self, PIKA_RES_OK); /* run method */ - if (method_type == ARG_TYPE_METHOD_NATIVE) { + if (methodType == ARG_TYPE_METHOD_NATIVE) { /* native method */ - method_ptr(self, locals->list); + fMethod(self, locals->list); /* get method return */ - return_arg = _get_return_arg(locals); - } else if (method_type == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR) { + aReturn = _get_return_arg(locals); + } else if (methodType == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR) { /* native method */ - method_ptr(self, locals->list); + fMethod(self, locals->list); /* get method return */ - return_arg = _get_return_arg(locals); + aReturn = _get_return_arg(locals); } else { /* static method and object method */ /* byteCode */ + ByteCodeFrame* method_bytecodeFrame = + methodArg_getBytecodeFrame(aMethod); uintptr_t insturctArray_start = (uintptr_t)instructArray_getByOffset( &(method_bytecodeFrame->instruct_array), 0); - uint16_t pc = (uintptr_t)method_ptr - insturctArray_start; - locals = __pikaVM_runByteCodeFrameWithState( + uint16_t pc = (uintptr_t)fMethod - insturctArray_start; + locals = _pikaVM_runByteCodeFrameWithState( self, locals, self, method_bytecodeFrame, pc, run_state); /* get method return */ - return_arg = _get_return_arg(locals); + aReturn = _get_return_arg(locals); } - return return_arg; +#if PIKA_TYPE_FULL_FEATURE_ENABLE + PikaObj* oReturn = NULL; + if (arg_isConstructor(aMethod)) { + if (arg_isObject(aReturn)) { + oReturn = arg_getPtr(aReturn); + obj_setArg(oReturn, "__class__", aMethod); + } + } +#endif + pika_assert_arg_alive(aReturn); + return aReturn; } Arg* obj_runMethodArgWithState(PikaObj* self, @@ -1180,23 +1316,9 @@ static int _get_n_input_with_unpack(VMState* vm, int n_used) { break; } if (arg_getIsStarred(call_arg)) { - pika_assert(argType_isObject(arg_getType(call_arg))); + pika_assert(arg_isObject(call_arg)); PikaObj* obj = arg_getPtr(call_arg); - /* clang-format off */ - PIKA_PYTHON( - @l = __len__() - ) - /* clang-format on */ - const uint8_t bytes[] = { - 0x08, 0x00, 0x00, 0x00, /* instruct array size */ - 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x09, 0x00, /* instruct - array */ - 0x0c, 0x00, 0x00, 0x00, /* const pool size */ - 0x00, 0x5f, 0x5f, 0x6c, 0x65, 0x6e, 0x5f, 0x5f, 0x00, - 0x40, 0x6c, 0x00, /* const pool */ - }; - pikaVM_runByteCode(obj, (uint8_t*)bytes); - int len = obj_getInt(obj, "@l"); + int len = _obj_getLen(obj); for (int i_star_arg = len - 1; i_star_arg >= 0; i_star_arg--) { obj_setInt(obj, "@d", i_star_arg); /* clang-format off */ @@ -1222,7 +1344,7 @@ static int _get_n_input_with_unpack(VMState* vm, int n_used) { goto __continue; } if (arg_getIsDoubleStarred(call_arg)) { - pika_assert(argType_isObject(arg_getType(call_arg))); + pika_assert(arg_isObject(call_arg)); PikaObj* New_PikaStdData_Dict(Args * args); PikaObj* obj = arg_getPtr(call_arg); pika_assert(obj->constructor == New_PikaStdData_Dict); @@ -1290,40 +1412,60 @@ static int VMState_loadArgsFromMethodArg(VMState* vm, f.n_input = _get_n_input_with_unpack(vm, n_used); - /* check arg num */ - if (f.method_type == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR || - f.method_type == ARG_TYPE_METHOD_CONSTRUCTOR || - f.is_vars == PIKA_TRUE || n_used != 0) { - /* skip for constrctor */ - /* skip for variable args */ - /* n_used != 0 means it is a factory method */ - } else { + do { + /* check arg num */ + if (f.method_type == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR || + f.method_type == ARG_TYPE_METHOD_CONSTRUCTOR || n_used != 0) { + /* skip for constrctor */ + /* skip for variable args */ + /* n_used != 0 means it is a factory method */ + break; + } /* check position arg num */ if (!vars_or_keys_or_default) { if (f.n_positional != f.n_input) { VMState_setErrorCode(vm, PIKA_RES_ERR_INVALID_PARAM); pika_platform_printf( - "TypeError: %s() takes %d positional argument but %d were " + "TypeError: %s() takes %d positional argument but %d " + "were " "given\r\n", method_name, f.n_positional, f.n_input); goto exit; } + break; } #if !PIKA_NANO_ENABLE + if (f.is_keys) { + break; + } + if (f.is_vars) { + if (f.n_input < f.n_positional) { + VMState_setErrorCode(vm, PIKA_RES_ERR_INVALID_PARAM); + pika_platform_printf( + "TypeError: %s() takes %d positional argument but " + "%d " + "were " + "given\r\n", + method_name, f.n_positional, f.n_input); + goto exit; + } + break; + } if (f.is_default) { int8_t n_min = f.n_positional; int8_t n_max = f.n_positional + f.n_default; if (f.n_input < n_min || f.n_input > n_max) { VMState_setErrorCode(vm, PIKA_RES_ERR_INVALID_PARAM); pika_platform_printf( - "TypeError: %s() takes from %d to %d positional arguments " + "TypeError: %s() takes from %d to %d positional " + "arguments " "but %d were given\r\n", method_name, n_min, n_max, f.n_input); goto exit; } } #endif - } + } while (0); if (vars_or_keys_or_default) { f.n_arg = f.n_input; @@ -1530,8 +1672,10 @@ static Arg* VM_instruction_handler_RET(PikaObj* self, Arg* arg_ret_reg) { /* exit jmp signal */ vm->jmp = VM_JMP_EXIT; - Arg* return_arg = stack_popArg_alloc(&(vm->stack)); - method_returnArg(vm->locals->list, return_arg); + Arg* aReturn = stack_popArg_alloc(&(vm->stack)); + /* set gc root to avoid gc */ + arg_setObjFlag(aReturn, OBJ_FLAG_GC_ROOT); + method_returnArg(vm->locals->list, aReturn); return NULL; } @@ -1555,7 +1699,7 @@ static char* _find_super_class_name(VMState* vm) { if (vm->pc + offset >= (int)VMState_getInstructArraySize(vm)) { return 0; } - if ((RUN == instructUnit_getInstruct( + if ((RUN == instructUnit_getInstructIndex( VMState_getInstructUnitWithOffset(vm, offset)))) { super_class_name = VMState_getConstWithOffset(vm, offset); return super_class_name; @@ -1584,7 +1728,7 @@ static char* _find_self_name(VMState* vm) { if (vm->pc + offset >= (int)VMState_getInstructArraySize(vm)) { return 0; } - if ((OUT == instructUnit_getInstruct( + if ((OUT == instructUnit_getInstructIndex( VMState_getInstructUnitWithOffset(vm, offset)))) { self_name = VMState_getConstWithOffset(vm, offset); return self_name; @@ -1596,73 +1740,73 @@ static char* _find_self_name(VMState* vm) { static Arg* VM_instruction_handler_RUN(PikaObj* self, VMState* vm, char* data, - Arg* arg_ret_reg) { - Arg* return_arg = NULL; - VMParameters* sub_locals = NULL; - char* run_path = data; - PikaObj* method_host = NULL; - PikaObj* obj_this = NULL; - Arg* method = NULL; - Arg* host_arg = NULL; - PIKA_BOOL is_temp = PIKA_FALSE; - PIKA_BOOL skip_init = PIKA_FALSE; - char* sys_out; - int n_used = 0; + Arg* aReturnRegistor) { + Arg* aReturn = NULL; + VMParameters* oSublocals = NULL; + VMParameters* oSublocalsInit = NULL; + char* sRunPath = data; + PikaObj* oMethodHost = NULL; + PikaObj* oThis = NULL; + Arg* aMethod = NULL; + Arg* aHost = NULL; + PIKA_BOOL bIsTemp = PIKA_FALSE; + PIKA_BOOL bSkipInit = PIKA_FALSE; + char* sSysOut; + int iNumUsed = 0; arg_newReg(arg_reg1, 64); - RunState sub_run_state = {.try_state = vm->run_state->try_state, - .try_result = TRY_RESULT_NONE}; + RunState tSubRunState = {.try_state = vm->run_state->try_state, + .try_result = TRY_RESULT_NONE}; pika_assert(NULL != vm->run_state); /* inhert */ if (vm->pc - 2 * (int)instructUnit_getSize() >= 0) { if (CLS == VMstate_getInstructWithOffset( vm, -2 * (int)instructUnit_getSize())) { - skip_init = PIKA_TRUE; + bSkipInit = PIKA_TRUE; } } /* tuple or single arg */ - if (NULL == run_path || run_path[0] == 0) { + if (NULL == sRunPath || sRunPath[0] == 0) { if (VMState_getInputArgNum(vm) == 1) { /* return arg directly */ - return_arg = stack_popArg(&(vm->stack), arg_ret_reg); + aReturn = stack_popArg(&(vm->stack), aReturnRegistor); goto exit; } /* create a tuple */ - return_arg = _vm_create_list_or_tuple(self, vm, PIKA_FALSE); + aReturn = _vm_create_list_or_tuple(self, vm, PIKA_FALSE); goto exit; } #if !PIKA_NANO_ENABLE /* support for super() */ - if (strEqu(run_path, "super")) { - run_path = _find_super_class_name(vm); + if (strEqu(sRunPath, "super")) { + sRunPath = _find_super_class_name(vm); vm->in_super = PIKA_TRUE; vm->super_invoke_deepth = VMState_getInvokeDeepthNow(vm); - skip_init = PIKA_TRUE; + bSkipInit = PIKA_TRUE; } #endif /* return tiny obj */ - if (strEqu(run_path, "TinyObj")) { - return_arg = arg_newMetaObj(New_TinyObj); + if (strEqu(sRunPath, "TinyObj")) { + aReturn = arg_newMetaObj(New_TinyObj); goto exit; } - if (strEqu(run_path, "object")) { - return_arg = arg_newMetaObj(New_TinyObj); + if (strEqu(sRunPath, "object")) { + aReturn = arg_newMetaObj(New_TinyObj); goto exit; } /* get method host obj from reg */ - if (NULL == method_host && _checkLReg(run_path)) { - uint8_t reg_index = _getLRegIndex(run_path); - method_host = vm->lreg[reg_index]; + if (NULL == oMethodHost) { + oMethodHost = Locals_getLReg(vm->locals, sRunPath); } #if !PIKA_NANO_ENABLE /* get method host obj from stack */ - if (NULL == method_host && run_path[0] == '.') { + if (NULL == oMethodHost && sRunPath[0] == '.') { /* get method host obj from stack */ Arg* stack_tmp[PIKA_ARG_NUM_MAX] = {0}; int n_arg = VMState_getInputArgNum(vm); @@ -1675,10 +1819,10 @@ static Arg* VM_instruction_handler_RUN(PikaObj* self, for (int i = 0; i < n_arg; i++) { stack_tmp[i] = stack_popArg_alloc(&(vm->stack)); } - host_arg = stack_tmp[n_arg - 1]; - method_host = _arg_to_obj(host_arg, &is_temp); - if (NULL != method_host) { - n_used++; + aHost = stack_tmp[n_arg - 1]; + oMethodHost = _arg_to_obj(aHost, &bIsTemp); + if (NULL != oMethodHost) { + iNumUsed++; } /* push back other args to stack */ for (int i = n_arg - 2; i >= 0; i--) { @@ -1688,78 +1832,80 @@ static Arg* VM_instruction_handler_RUN(PikaObj* self, #endif /* get method host obj from local scope */ - if (NULL == method_host) { - method_host = obj_getHostObjWithIsTemp(vm->locals, run_path, &is_temp); + if (NULL == oMethodHost) { + oMethodHost = obj_getHostObjWithIsTemp(vm->locals, sRunPath, &bIsTemp); } /* get method host obj from global scope */ - if (NULL == method_host) { - method_host = obj_getHostObjWithIsTemp(vm->globals, run_path, &is_temp); + if (NULL == oMethodHost) { + oMethodHost = obj_getHostObjWithIsTemp(vm->globals, sRunPath, &bIsTemp); } /* method host obj is not found */ - if (NULL == method_host) { + if (NULL == oMethodHost) { /* error, not found object */ VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); - pika_platform_printf("Error: method '%s' no found.\r\n", run_path); + pika_platform_printf("Error: method '%s' no found.\r\n", sRunPath); goto exit; } + pika_assert(obj_checkAlive(oMethodHost)); + #if !PIKA_NANO_ENABLE - if (!skip_init && vm->in_super && + if (!bSkipInit && vm->in_super && VMState_getInvokeDeepthNow(vm) == vm->super_invoke_deepth - 1) { vm->in_super = PIKA_FALSE; - obj_this = obj_getPtr(vm->locals, _find_self_name(vm)); + oThis = obj_getPtr(vm->locals, _find_self_name(vm)); } #endif /* get object this */ - if (NULL == obj_this) { - obj_this = method_host; + if (NULL == oThis) { + oThis = oMethodHost; } /* get method in object */ - if (NULL == method) { - method = obj_getMethodArg_noalloc(method_host, run_path, &arg_reg1); + if (NULL == aMethod) { + aMethod = obj_getMethodArg_noalloc(oMethodHost, sRunPath, &arg_reg1); } /* get method in locals */ - if (NULL == method) { - method = obj_getMethodArg_noalloc(vm->locals, run_path, &arg_reg1); + if (NULL == aMethod) { + aMethod = obj_getMethodArg_noalloc(vm->locals, sRunPath, &arg_reg1); } /* get method in global */ - if (NULL == method) { - method = obj_getMethodArg_noalloc(vm->globals, run_path, &arg_reg1); - if (method != NULL) { - obj_this = vm->globals; + if (NULL == aMethod) { + aMethod = obj_getMethodArg_noalloc(vm->globals, sRunPath, &arg_reg1); + if (aMethod != NULL) { + oThis = vm->globals; } } /* assert method exist */ - if (NULL == method || ARG_TYPE_NONE == arg_getType(method)) { + if (NULL == aMethod || ARG_TYPE_NONE == arg_getType(aMethod)) { /* error, method no found */ VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); pika_platform_printf("NameError: name '%s' is not defined\r\n", - run_path); + sRunPath); goto exit; } /* assert methodd type */ - if (!argType_isCallable(arg_getType(method))) { + if (!argType_isCallable(arg_getType(aMethod))) { /* error, method no found */ VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); pika_platform_printf("TypeError: '%s' object is not callable\r\n", - run_path); + sRunPath); goto exit; } /* create sub local scope */ - sub_locals = New_PikaObj(); + oSublocals = New_Locals(NULL); /* load args from vmState to sub_local->list */ - n_used += VMState_loadArgsFromMethodArg(vm, obj_this, sub_locals->list, - method, run_path, n_used); + iNumUsed += VMState_loadArgsFromMethodArg(vm, oThis, oSublocals->list, + aMethod, sRunPath, iNumUsed); /* load args failed */ if (vm->error_code != 0) { @@ -1767,80 +1913,86 @@ static Arg* VM_instruction_handler_RUN(PikaObj* self, } /* run method arg */ - return_arg = obj_runMethodArgWithState_noalloc(obj_this, sub_locals, method, - &sub_run_state, arg_ret_reg); - if (skip_init) { - if (arg_getType(return_arg) == ARG_TYPE_OBJECT_NEW) { - pika_assert(NULL != return_arg); - arg_setType(return_arg, ARG_TYPE_OBJECT); + aReturn = obj_runMethodArgWithState_noalloc(oThis, oSublocals, aMethod, + &tSubRunState, aReturnRegistor); + if (bSkipInit) { + if (arg_getType(aReturn) == ARG_TYPE_OBJECT_NEW) { + pika_assert(NULL != aReturn); + arg_setType(aReturn, ARG_TYPE_OBJECT); } } - if (sub_run_state.try_result != TRY_RESULT_NONE) { + if (tSubRunState.try_result != TRY_RESULT_NONE) { /* try result */ - vm->error_code = sub_run_state.try_result; + vm->error_code = tSubRunState.try_result; } /* __init__() */ - if (NULL != return_arg && ARG_TYPE_OBJECT_NEW == arg_getType(return_arg)) { - pika_assert(NULL != return_arg); - arg_setType(return_arg, ARG_TYPE_OBJECT); + if (NULL != aReturn && ARG_TYPE_OBJECT_NEW == arg_getType(aReturn)) { + pika_assert(NULL != aReturn); + arg_setType(aReturn, ARG_TYPE_OBJECT); /* init object */ - PikaObj* new_obj = arg_getPtr(return_arg); - Arg* method_arg = - obj_getMethodArg_noalloc(new_obj, "__init__", &arg_reg1); - PikaObj* sub_locals = New_PikaObj(); - Arg* return_arg_init = NULL; - if (NULL == method_arg) { + PikaObj* oNew = arg_getPtr(aReturn); + obj_setName(oNew, sRunPath); + Arg* aMethod = obj_getMethodArg_noalloc(oNew, "__init__", &arg_reg1); + oSublocalsInit = New_Locals(NULL); + Arg* aReturnInit = NULL; + if (NULL == aMethod) { goto init_exit; } - VMState_loadArgsFromMethodArg(vm, new_obj, sub_locals->list, method_arg, - "__init__", n_used); + VMState_loadArgsFromMethodArg(vm, oNew, oSublocalsInit->list, aMethod, + "__init__", iNumUsed); /* load args failed */ if (vm->error_code != 0) { goto init_exit; } - return_arg_init = obj_runMethodArgWithState(new_obj, sub_locals, - method_arg, &sub_run_state); + aReturnInit = obj_runMethodArgWithState(oNew, oSublocalsInit, aMethod, + &tSubRunState); init_exit: - if (NULL != return_arg_init) { - arg_deinit(return_arg_init); + if (NULL != aReturnInit) { + arg_deinit(aReturnInit); } - obj_deinit(sub_locals); - if (NULL != method_arg) { - arg_deinit(method_arg); +#if PIKA_GC_MARK_SWEEP_ENABLE + pika_assert(obj_getFlag(oSublocals, OBJ_FLAG_GC_ROOT)); +#endif + obj_deinit(oSublocalsInit); + if (NULL != aMethod) { + arg_deinit(aMethod); } } /* transfer sysOut */ - sys_out = obj_getSysOut(obj_this); - if (NULL != sys_out) { - args_setSysOut(vm->locals->list, sys_out); + sSysOut = obj_getSysOut(oThis); + if (NULL != sSysOut) { + args_setSysOut(vm->locals->list, sSysOut); } /* transfer errCode */ - if (0 != obj_getErrorCode(obj_this)) { + if (0 != obj_getErrorCode(oThis)) { /* method error */ VMState_setErrorCode(vm, PIKA_RES_ERR_RUNTIME_ERROR); } goto exit; exit: - if (NULL != method) { - arg_deinit(method); + if (NULL != aMethod) { + arg_deinit(aMethod); } - if (NULL != sub_locals) { - obj_deinit(sub_locals); + if (NULL != oSublocals) { +#if PIKA_GC_MARK_SWEEP_ENABLE + pika_assert(obj_getFlag(oSublocals, OBJ_FLAG_GC_ROOT)); +#endif + obj_deinit(oSublocals); } - if (NULL != host_arg) { - arg_deinit(host_arg); + if (NULL != aHost) { + arg_deinit(aHost); } - if (NULL != method_host && is_temp) { + if (NULL != oMethodHost && bIsTemp) { /* class method */ - obj_GC(method_host); + obj_GC(oMethodHost); } - - return return_arg; + pika_assert_arg_alive(aReturn); + return aReturn; } static char* __get_transferd_str(Args* buffs, char* str, size_t* iout_p) { @@ -1962,85 +2114,83 @@ static PIKA_BOOL _proxy_setattr(PikaObj* self, char* name, Arg* arg) { static Arg* VM_instruction_handler_OUT(PikaObj* self, VMState* vm, char* data, - Arg* arg_ret_reg) { - char* arg_path = data; - char* arg_name = strPointToLastToken(arg_path, '.'); - PikaObj* host_obj = NULL; - PIKA_BOOL is_temp = PIKA_FALSE; - arg_newReg(outArg_reg, PIKA_ARG_BUFF_SIZE); - Arg* out_arg = stack_popArg(&vm->stack, &outArg_reg); - // Arg* outArg = stack_popArg_alloc(&vm->stack); - if (NULL == out_arg) { + Arg* aRetReg) { + char* sArgPath = data; + char* sArgName = strPointToLastToken(sArgPath, '.'); + PikaObj* oHost = NULL; + PIKA_BOOL bIsTemp = PIKA_FALSE; + arg_newReg(aOutReg, PIKA_ARG_BUFF_SIZE); + Arg* aOut = stack_popArg(&vm->stack, &aOutReg); + if (NULL == aOut) { return NULL; } - ArgType outArg_type = arg_getType(out_arg); + ArgType eOutArgType = arg_getType(aOut); if (VMState_getInvokeDeepthNow(vm) > 0) { /* in block, is a kw arg */ - arg_setIsKeyword(out_arg, PIKA_TRUE); - arg_setName(out_arg, arg_path); - Arg* res = arg_copy_noalloc(out_arg, arg_ret_reg); - arg_deinit(out_arg); + arg_setIsKeyword(aOut, PIKA_TRUE); + arg_setName(aOut, sArgPath); + Arg* res = arg_copy_noalloc(aOut, aRetReg); + arg_deinit(aOut); return res; } - if (_checkLReg(arg_path)) { - uint8_t index = _getLRegIndex(arg_path); - if (argType_isObject(outArg_type)) { - PikaObj* obj = arg_getPtr(out_arg); - VMState_setLReg(vm, index, obj); - arg_deinit(out_arg); + if (_checkLReg(sArgPath)) { + if (argType_isObject(eOutArgType)) { + PikaObj* obj = arg_getPtr(aOut); + Locals_setLReg(vm->locals, sArgPath, obj); + arg_deinit(aOut); } return NULL; } - PikaObj* context = vm->locals; + PikaObj* oContext = vm->locals; /* match global_list */ if (obj_getFlag(vm->locals, OBJ_FLAG_GLOBALS)) { - char* global_list = args_getStr(vm->locals->list, "@g"); + char* sGlobalList = args_getStr(vm->locals->list, "@g"); /* use a arg as buff */ - Arg* global_list_arg = arg_newStr(global_list); - char* global_list_buff = arg_getStr(global_list_arg); + Arg* aGlobalList = arg_newStr(sGlobalList); + char* sGlobalListBuff = arg_getStr(aGlobalList); /* for each arg arg in global_list */ - for (int i = 0; i < strCountSign(global_list, ',') + 1; i++) { - char* global_arg = strPopFirstToken(&global_list_buff, ','); + for (int i = 0; i < strCountSign(sGlobalList, ',') + 1; i++) { + char* sGlobalArg = strPopFirstToken(&sGlobalListBuff, ','); /* matched global arg, context set to global */ - if (strEqu(global_arg, arg_path)) { - context = vm->globals; + if (strEqu(sGlobalArg, sArgPath)) { + oContext = vm->globals; } } - arg_deinit(global_list_arg); + arg_deinit(aGlobalList); } /* use RunAs object */ if (obj_getFlag(vm->locals, OBJ_FLAG_RUN_AS)) { - context = args_getPtr(vm->locals->list, "@r"); + oContext = args_getPtr(vm->locals->list, "@r"); } /* set free object to nomal object */ - if (ARG_TYPE_OBJECT_NEW == outArg_type) { - pika_assert(NULL != out_arg); - arg_setType(out_arg, ARG_TYPE_OBJECT); + if (ARG_TYPE_OBJECT_NEW == eOutArgType) { + pika_assert(NULL != aOut); + arg_setType(aOut, ARG_TYPE_OBJECT); } /* ouput arg to context */ - if (arg_path == arg_name) { - obj_setArg_noCopy(context, arg_path, out_arg); + if (sArgPath == sArgName) { + obj_setArg_noCopy(oContext, sArgPath, aOut); return NULL; } - host_obj = obj_getHostObjWithIsTemp(context, arg_path, &is_temp); + oHost = obj_getHostObjWithIsTemp(oContext, sArgPath, &bIsTemp); - if (NULL == host_obj) { - host_obj = obj_getHostObjWithIsTemp(vm->globals, arg_path, &is_temp); + if (NULL == oHost) { + oHost = obj_getHostObjWithIsTemp(vm->globals, sArgPath, &bIsTemp); } - if (host_obj != NULL) { - if (_proxy_setattr(host_obj, arg_name, out_arg)) { + if (oHost != NULL) { + if (_proxy_setattr(oHost, sArgName, aOut)) { return NULL; } - obj_setArg_noCopy(host_obj, arg_name, out_arg); + obj_setArg_noCopy(oHost, sArgName, aOut); return NULL; } - obj_setArg_noCopy(context, arg_path, out_arg); + obj_setArg_noCopy(oContext, sArgPath, aOut); return NULL; } @@ -2172,7 +2322,7 @@ static uint8_t VMState_getInputArgNum(VMState* vm) { break; } if (invode_deepth == invoke_deepth_this + 1) { - if (instructUnit_getInstruct(ins_unit_now) == OUT) { + if (instructUnit_getInstructIndex(ins_unit_now) == OUT) { continue; } num++; @@ -2243,7 +2393,7 @@ static void _OPT_ADD(OperatorInfo* op) { obj_setPtr(obj1, "__others", obj2); /* clang-format off */ PIKA_PYTHON( - __res = __add__(__others) + @res_add = __add__(__others) ) /* clang-format on */ const uint8_t bytes[] = { @@ -2251,16 +2401,15 @@ static void _OPT_ADD(OperatorInfo* op) { 0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04, 0x12, 0x00, /* instruct array */ - 0x18, 0x00, 0x00, 0x00, /* const pool size */ + 0x1b, 0x00, 0x00, 0x00, /* const pool size */ 0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00, 0x5f, - 0x5f, 0x61, 0x64, 0x64, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65, - 0x73, 0x00, /* const pool */ + 0x5f, 0x61, 0x64, 0x64, 0x5f, 0x5f, 0x00, 0x40, 0x72, 0x65, 0x73, + 0x5f, 0x61, 0x64, 0x64, 0x00, /* const pool */ }; - pikaVM_runByteCode(obj1, (uint8_t*)bytes); - Arg* __res = arg_copy(obj_getArg(obj1, "__res")); - op->res = __res; + Arg* res_add = + pikaVM_runByteCodeReturn(obj1, (uint8_t*)bytes, "@res_add"); obj_removeArg(obj1, "__others"); - obj_removeArg(obj1, "__res"); + op->res = res_add; return; } #endif @@ -2321,7 +2470,7 @@ static void _OPT_SUB(OperatorInfo* op) { obj_setPtr(obj1, "__others", obj2); /* clang-format off */ PIKA_PYTHON( - __res = __sub__(__others) + @res_sub = __sub__(__others) ) /* clang-format on */ const uint8_t bytes[] = { @@ -2329,16 +2478,15 @@ static void _OPT_SUB(OperatorInfo* op) { 0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04, 0x12, 0x00, /* instruct array */ - 0x18, 0x00, 0x00, 0x00, /* const pool size */ + 0x1b, 0x00, 0x00, 0x00, /* const pool size */ 0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00, 0x5f, - 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65, - 0x73, 0x00, /* const pool */ + 0x5f, 0x73, 0x75, 0x62, 0x5f, 0x5f, 0x00, 0x40, 0x72, 0x65, 0x73, + 0x5f, 0x73, 0x75, 0x62, 0x00, /* const pool */ }; - pikaVM_runByteCode(obj1, (uint8_t*)bytes); - Arg* __res = arg_copy(obj_getArg(obj1, "__res")); - op->res = __res; + Arg* res_sub = + pikaVM_runByteCodeReturn(obj1, (uint8_t*)bytes, "@res_sub"); obj_removeArg(obj1, "__others"); - obj_removeArg(obj1, "__res"); + op->res = res_sub; return; } #endif @@ -2566,25 +2714,27 @@ static Arg* VM_instruction_handler_OPT(PikaObj* self, Arg* __contains__ = obj_getMethodArg(obj2, "__contains__"); if (NULL != __contains__) { arg_deinit(__contains__); + obj_setArg(obj2, "__others", op.a1); /* clang-format off */ PIKA_PYTHON( - __res = __contains__(__others) + @res_contains = __contains__(__others) ) - obj_setArg(obj2, "__others", op.a1); /* clang-format on */ const uint8_t bytes[] = { 0x0c, 0x00, 0x00, 0x00, /* instruct array size */ 0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x0a, 0x00, 0x00, 0x04, 0x17, 0x00, /* instruct array */ - 0x1d, 0x00, 0x00, 0x00, /* const pool size */ + 0x25, 0x00, 0x00, 0x00, /* const pool size */ 0x00, 0x5f, 0x5f, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x73, 0x00, 0x5f, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, - 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65, 0x73, - 0x00, /* const pool */ + 0x5f, 0x5f, 0x00, 0x40, 0x72, 0x65, 0x73, 0x5f, 0x63, 0x6f, + 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x73, 0x00, + /* const pool */ }; pikaVM_runByteCode(obj2, (uint8_t*)bytes); - op.res = arg_setBool(op.res, "", obj_getInt(obj2, "__res")); + op.res = + arg_setBool(op.res, "", obj_getInt(obj2, "@res_contains")); goto exit; } } @@ -2790,14 +2940,14 @@ static Arg* VM_instruction_handler_ASS(PikaObj* self, arg_getBool(arg1) == PIKA_FALSE)) { stack_pushArg(&vm->stack, arg_newInt(PIKA_RES_ERR_ASSERT)); res = VM_instruction_handler_RIS(self, vm, data, arg_ret_reg); - if (vm->run_state->try_state == TRY_STATE_NONE) { - if (n_arg == 1) { - pika_platform_printf("AssertionError\n"); - } - if (n_arg == 2) { - pika_platform_printf("AssertionError: %s\n", arg_getStr(arg2)); - } + // if (vm->run_state->try_state == TRY_STATE_NONE) { + if (n_arg == 1) { + pika_platform_printf("AssertionError\n"); } + if (n_arg == 2) { + pika_platform_printf("AssertionError: %s\n", arg_getStr(arg2)); + } + // } goto exit; } exit: @@ -2825,20 +2975,20 @@ static Arg* VM_instruction_handler_DEL(PikaObj* self, char* data, Arg* arg_ret_reg) { if (_checkLReg(data)) { - uint8_t reg_index = _getLRegIndex(data); - VMState_delLReg(vm, reg_index); - return NULL; + Locals_delLReg(vm->locals, data); + goto __exit; } if (obj_isArgExist(vm->locals, data)) { obj_removeArg(vm->locals, data); - return NULL; + goto __exit; } if (obj_isArgExist(vm->globals, data)) { obj_removeArg(vm->globals, data); - return NULL; + goto __exit; } VMState_setErrorCode(vm, PIKA_RES_ERR_OPERATION_FAILED); pika_platform_printf("NameError: name '%s' is not defined\n", data); +__exit: return NULL; } @@ -2918,25 +3068,181 @@ static Arg* VM_instruction_handler_IMP(PikaObj* self, return NULL; } VMState_setErrorCode(vm, PIKA_RES_ERR_ARG_NO_FOUND); - pika_platform_printf("ModuleNotFoundError: No module named '%s'\r\n", data); + if (vm->run_state->try_state == TRY_STATE_NONE) { + pika_platform_printf("ModuleNotFoundError: No module named '%s'\r\n", + data); + } return NULL; } -const VM_instruct_handler VM_instruct_handler_table[__INSTRCUTION_CNT] = { -#define __INS_TABLE +#if PIKA_INSTRUCT_EXTENSION_ENABLE +const VMInstructionSet VM_default_instruction_set = { +#define __INS_OPCODE + .instructions = + (const VMInstruction[]){ #include "__instruction_table.h" + }, + .count = __INSTRUCTION_CNT, + .op_idx_start = NON, + .op_idx_end = NON + __INSTRUCTION_CNT - 1, }; -enum Instruct pikaVM_getInstructFromAsm(char* ins_str) { -#define __INS_COMPIRE +#ifndef PIKA_INSTRUCT_SIGNATURE_DICT +#define PIKA_INSTRUCT_SIGNATURE_DICT 0 +#endif + +typedef struct VMInstructionSetItem VMInstructionSetItem; +struct VMInstructionSetItem { + VMInstructionSetItem* next; + const VMInstructionSet* ins_set; +}; + +static struct { + const VMInstructionSetItem default_ins_set; + VMInstructionSetItem* list; + VMInstructionSetItem* recent; +#if PIKA_INSTRUCT_SIGNATURE_DICT_COUNT > 0 + const uint16_t signature_dict[PIKA_INSTRUCT_SIGNATURE_DICT_COUNT]; +#endif +} VM = { + .default_ins_set = + { + .ins_set = &VM_default_instruction_set, + .next = NULL, + }, + .list = (VMInstructionSetItem*)&VM.default_ins_set, + .recent = (VMInstructionSetItem*)&VM.default_ins_set, +#if PIKA_INSTRUCT_SIGNATURE_DICT_COUNT > 0 + .signature_dict = {PIKA_INSTRUCT_SIGNATURE_DICT}, +#endif +}; + +PIKA_BOOL pikaVM_registerInstructionSet(VMInstructionSet* ins_set) { + pika_assert(NULL != ins_set); + +#if PIKA_INSTRUCT_SIGNATURE_DICT_COUNT > 0 + uint16_t signature = ins_set->signature; + + PIKA_BOOL ins_set_valid = PIKA_FALSE; + for (int n = 0; n < sizeof(VM.signature_dict) / sizeof(uint16_t); n++) { + if (VM.signature_dict[n] == signature) { + ins_set_valid = PIKA_TRUE; + break; + } + } + if (!ins_set_valid) { + return PIKA_FALSE; + } +#endif + + /* check whether the target instruction set exists or not */ + VMInstructionSetItem* list_item = VM.list; + do { + if (list_item->ins_set->signature == signature) { + return PIKA_TRUE; /* already exist */ + } + + list_item = list_item->next; + } while (NULL != list_item->next); + + VMInstructionSetItem* item = + pika_platform_malloc(sizeof(VMInstructionSetItem)); + if (NULL == item) { + return PIKA_FALSE; + } + item->ins_set = ins_set; + item->next = NULL; + + /* add item to the tail of VM.list */ + list_item->next = item; + + return PIKA_TRUE; +} + +static const VMInstruction* instructUnit_getInstruct( + enum InstructIndex ins_idx) { + VMInstructionSetItem* item = VM.recent; + + if ((ins_idx >= item->ins_set->op_idx_start) && + (ins_idx <= item->ins_set->op_idx_end)) { + return &( + item->ins_set->instructions[ins_idx - item->ins_set->op_idx_start]); + } + + /* search list */ + item = VM.list; + do { + if ((ins_idx >= item->ins_set->op_idx_start) && + (ins_idx <= item->ins_set->op_idx_end)) { + VM.recent = item; + return &(item->ins_set + ->instructions[ins_idx - item->ins_set->op_idx_start]); + } + item = item->next; + } while (NULL != item->next); + + return NULL; +} + +static enum InstructIndex __find_ins_idx_in_ins_set( + char* ins_str, + const VMInstructionSet* set) { + const VMInstruction* ins = set->instructions; + uint_fast16_t count = set->count; + + do { + if (0 == strncmp(ins_str, ins->op_str, ins->op_str_len)) { + return ins->op_idx; + } + ins++; + } while (--count); + return __INSTRUCTION_UNKNOWN; +} + +enum InstructIndex pikaVM_getInstructFromAsm(char* ins_str) { + enum InstructIndex ins_idx = + __find_ins_idx_in_ins_set(ins_str, VM.recent->ins_set); + + if (__INSTRUCTION_UNKNOWN == ins_idx) { + VMInstructionSetItem* item = VM.list; + + do { + ins_idx = __find_ins_idx_in_ins_set(ins_str, item->ins_set); + if (__INSTRUCTION_UNKNOWN != ins_idx) { + VM.recent = item; + return ins_idx; + } + item = item->next; + } while (NULL != item->next); + + return NON; + } + + return ins_idx; +} + +#else + +PIKA_BOOL pikaVM_registerInstructionSet(VMInstructionSet* ins_set) { + return PIKA_FALSE; +} + +enum InstructIndex pikaVM_getInstructFromAsm(char* ins_str) { +#define __INS_COMPARE #include "__instruction_table.h" return NON; } +const VM_instruct_handler VM_instruct_handler_table[__INSTRUCTION_CNT] = { +#define __INS_TABLE +#include "__instruction_table.h" +}; +#endif + static int pikaVM_runInstructUnit(PikaObj* self, VMState* vm, InstructUnit* ins_unit) { - enum Instruct instruct = instructUnit_getInstruct(ins_unit); + enum InstructIndex instruct = instructUnit_getInstructIndex(ins_unit); arg_newReg(ret_reg, PIKA_ARG_BUFF_SIZE); Arg* return_arg = &ret_reg; // char invode_deepth1_str[2] = {0}; @@ -2944,7 +3250,19 @@ static int pikaVM_runInstructUnit(PikaObj* self, char* data = VMState_getConstWithInstructUnit(vm, ins_unit); /* run instruct */ pika_assert(NULL != vm->run_state); + +#if PIKA_INSTRUCT_EXTENSION_ENABLE + const VMInstruction* ins = instructUnit_getInstruct(instruct); + if (NULL == ins) { + /* todo: unsupported instruction */ + pika_assert(NULL != ins); + } + pika_assert(NULL != ins->handler); + + return_arg = ins->handler(self, vm, data, &ret_reg); +#else return_arg = VM_instruct_handler_table[instruct](self, vm, data, &ret_reg); +#endif if (vm->error_code != PIKA_RES_OK || VMSignal_getCtrl() == VM_SIGNAL_CTRL_EXIT) { @@ -3063,8 +3381,8 @@ static ByteCodeFrame* _cache_bcf_fn(PikaObj* self, char* py_lines) { } static char* _get_data_from_bytecode2(uint8_t* bytecode, - enum Instruct ins1, - enum Instruct ins2) { + enum InstructIndex ins1, + enum InstructIndex ins2) { ByteCodeFrame bf = {0}; char* res = NULL; byteCodeFrame_init(&bf); @@ -3074,7 +3392,7 @@ static char* _get_data_from_bytecode2(uint8_t* bytecode, if (NULL == ins_unit) { goto __exit; } - enum Instruct ins = instructUnit_getInstruct(ins_unit); + enum InstructIndex ins = instructUnit_getInstructIndex(ins_unit); if (ins == ins1 || ins == ins2) { res = constPool_getByOffset(&bf.const_pool, ins_unit->const_pool_index); @@ -3095,7 +3413,7 @@ static ByteCodeFrame* _cache_bcf_fn_bc(PikaObj* self, uint8_t* bytecode) { return _cache_bytecodeframe(self); } -static VMParameters* __pikaVM_runPyLines(PikaObj* self, char* py_lines) { +static VMParameters* _pikaVM_runPyLines(PikaObj* self, char* py_lines) { VMParameters* globals = NULL; ByteCodeFrame bytecode_frame_stack = {0}; ByteCodeFrame* bytecode_frame_p = NULL; @@ -3159,8 +3477,8 @@ VMParameters* _do_pikaVM_runByteCode(PikaObj* self, /* run byteCode */ - globals = __pikaVM_runByteCodeFrameWithState( - self, locals, globals, bytecode_frame_p, 0, run_state); + globals = _pikaVM_runByteCodeFrameWithState(self, locals, globals, + bytecode_frame_p, 0, run_state); goto exit; exit: if (!is_use_heap_bytecode) { @@ -3200,7 +3518,7 @@ VMParameters* pikaVM_runSingleFile(PikaObj* self, char* filename) { } VMParameters* pikaVM_run(PikaObj* self, char* py_lines) { - return __pikaVM_runPyLines(self, py_lines); + return _pikaVM_runPyLines(self, py_lines); } VMParameters* pikaVM_runByteCode(PikaObj* self, const uint8_t* bytecode) { @@ -3210,6 +3528,41 @@ VMParameters* pikaVM_runByteCode(PikaObj* self, const uint8_t* bytecode) { &run_state, PIKA_TRUE); } +Arg* pikaVM_runByteCodeReturn(PikaObj* self, + const uint8_t* bytecode, + char* returnName) { + pikaVM_runByteCode(self, bytecode); + Arg* ret = args_getArg(self->list, returnName); + if (NULL == ret) { + return NULL; + } + ret = arg_copy(ret); + /* set gc root to avoid be free */ + arg_setObjFlag(ret, OBJ_FLAG_GC_ROOT); + obj_removeArg(self, returnName); + return ret; +} + +Arg* _do_pikaVM_runByteCodeReturn(PikaObj* self, + VMParameters* locals, + VMParameters* globals, + uint8_t* bytecode, + RunState* run_state, + PIKA_BOOL is_const_bytecode, + char* return_name) { + _do_pikaVM_runByteCode(self, locals, globals, bytecode, run_state, + is_const_bytecode); + Arg* ret = args_getArg(self->list, return_name); + if (NULL == ret) { + return NULL; + } + ret = arg_copy(ret); + /* set gc root to avoid be free */ + arg_setObjFlag(ret, OBJ_FLAG_GC_ROOT); + obj_removeArg(self, return_name); + return ret; +} + VMParameters* pikaVM_runByteCodeInconstant(PikaObj* self, uint8_t* bytecode) { RunState run_state = {.try_state = TRY_STATE_NONE, .try_result = TRY_RESULT_NONE}; @@ -3419,11 +3772,47 @@ InstructUnit* instructArray_getNext(InstructArray* self) { return instructArray_getNow(self); } +#if PIKA_INSTRUCT_EXTENSION_ENABLE + +static const char* __find_ins_str_in_ins_set(enum InstructIndex op_idx, + const VMInstructionSet* set) { + const VMInstruction* ins = set->instructions; + uint_fast16_t count = set->count; + + do { + if (ins->op_idx == op_idx) { + return ins->op_str; + } + ins++; + } while (--count); + return NULL; +} + +static char* instructUnit_getInstructStr(InstructUnit* self) { + enum InstructIndex op_idx = instructUnit_getInstructIndex(self); + + const char* ins_str = __find_ins_str_in_ins_set(op_idx, VM.recent->ins_set); + if (NULL != ins_str) { + return (char*)ins_str; + } + VMInstructionSetItem* item = VM.list; + do { + ins_str = __find_ins_str_in_ins_set(op_idx, item->ins_set); + if (NULL != ins_str) { + VM.recent = item; + return (char*)ins_str; + } + item = item->next; + } while (NULL != item->next); + return "NON"; +} +#else static char* instructUnit_getInstructStr(InstructUnit* self) { #define __INS_GET_INS_STR #include "__instruction_table.h" return "NON"; } +#endif void instructUnit_print(InstructUnit* self) { if (instructUnit_getIsNewLine(self)) { @@ -3539,7 +3928,7 @@ void VMState_solveUnusedStack(VMState* vm) { } } -static VMParameters* __pikaVM_runByteCodeFrameWithState( +static VMParameters* _pikaVM_runByteCodeFrameWithState( PikaObj* self, VMParameters* locals, VMParameters* globals, @@ -3564,10 +3953,10 @@ static VMParameters* __pikaVM_runByteCodeFrameWithState( .super_invoke_deepth = 0}; stack_init(&(vm.stack)); VMState_initReg(&vm); - if (PikaVMSignal.vm_cnt == 0) { + if (g_PikaVMSignal.vm_cnt == 0) { pks_vmSignal_setCtrlElear(); } - PikaVMSignal.vm_cnt++; + g_PikaVMSignal.vm_cnt++; while (vm.pc < size) { if (vm.pc == VM_PC_EXIT) { break; @@ -3587,7 +3976,9 @@ static VMParameters* __pikaVM_runByteCodeFrameWithState( pika_hook_instruct(); } #endif - _pikaVM_yield(); + if (vm.ins_cnt % PIKA_INSTRUCT_YIELD_PERIOD == 0) { + _pikaVM_yield(); + } if (0 != vm.error_code) { vm.line_error_code = vm.error_code; InstructUnit* head_ins_unit = this_ins_unit; @@ -3623,7 +4014,7 @@ static VMParameters* __pikaVM_runByteCodeFrameWithState( } VMState_solveUnusedStack(&vm); stack_deinit(&(vm.stack)); - PikaVMSignal.vm_cnt--; + g_PikaVMSignal.vm_cnt--; return locals; } @@ -3631,8 +4022,8 @@ VMParameters* pikaVM_runByteCodeFrame(PikaObj* self, ByteCodeFrame* byteCode_frame) { RunState run_state = {.try_state = TRY_STATE_NONE, .try_result = TRY_RESULT_NONE}; - return __pikaVM_runByteCodeFrameWithState(self, self, self, byteCode_frame, - 0, &run_state); + return _pikaVM_runByteCodeFrameWithState(self, self, self, byteCode_frame, + 0, &run_state); } void constPool_printAsArray(ConstPool* self) { @@ -3696,8 +4087,9 @@ PikaObj* pikaVM_runFile(PikaObj* self, char* file_name) { pikaMemMaxReset(); char* libfile_path = strsPathJoin(&buffs, pwd, "pikascript-api/pikaModules_cache.py.a"); - obj_linkLibraryFile(self, libfile_path); - self = pikaVM_runSingleFile(self, file_name); + if (PIKA_RES_OK == obj_linkLibraryFile(self, libfile_path)) { + self = pikaVM_runSingleFile(self, file_name); + } strsDeinit(&buffs); return self; } diff --git a/examples/pikapython/pikapython/pikascript-core/PikaVM.h b/examples/pikapython/pikapython/pikascript-core/PikaVM.h index 8ce8268a..65fd69c9 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaVM.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaVM.h @@ -1,6 +1,6 @@ /* * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * http://github.com/pikastech/pikapython * * MIT License * @@ -35,10 +35,12 @@ #include #endif -enum Instruct { +enum InstructIndex { #define __INS_ENUM #include "__instruction_table.h" - __INSTRCUTION_CNT, + __INSTRUCTION_CNT, + __INSTRUCTION_INDEX_MAX = 0xFFFF, + __INSTRUCTION_UNKNOWN = 0xFFFF, }; typedef enum { @@ -81,9 +83,8 @@ struct VMState { uint32_t ins_cnt; PIKA_BOOL in_super; uint8_t super_invoke_deepth; - PikaObj* lreg[PIKA_REGIST_SIZE]; - PIKA_BOOL ireg[PIKA_REGIST_SIZE]; RunState* run_state; + PIKA_BOOL ireg[PIKA_REGIST_SIZE]; }; typedef struct { @@ -149,9 +150,34 @@ struct VMSignal { int vm_cnt; #if PIKA_EVENT_ENABLE EventCQ cq; + int event_pickup_cnt; + int event_thread_inited; #endif }; +typedef Arg* (*VM_instruct_handler)(PikaObj* self, + VMState* vm, + char* data, + Arg* arg_ret_reg); + +typedef struct VMInstruction VMInstruction; +struct VMInstruction { + VM_instruct_handler handler; + const char* op_str; + uint16_t op_idx; + uint16_t op_str_len : 4; + uint16_t : 12; +}; + +typedef struct VMInstructionSet VMInstructionSet; +struct VMInstructionSet { + const VMInstruction* instructions; + uint16_t count; + uint16_t signature; + uint16_t op_idx_start; + uint16_t op_idx_end; +}; + VMParameters* pikaVM_run(PikaObj* self, char* pyLine); VMParameters* pikaVM_runAsm(PikaObj* self, char* pikaAsm); VMParameters* pikaVM_runByteCodeFrame(PikaObj* self, @@ -165,8 +191,9 @@ static inline int instructUnit_getInvokeDeepth(InstructUnit* self) { return self->deepth >> 4; } -static inline enum Instruct instructUnit_getInstruct(InstructUnit* self) { - return (enum Instruct)(self->isNewLine_instruct & 0x7F); +static inline enum InstructIndex instructUnit_getInstructIndex( + InstructUnit* self) { + return (enum InstructIndex)(self->isNewLine_instruct & 0x7F); } static inline int instructUnit_getConstPoolIndex(InstructUnit* self) { @@ -200,7 +227,7 @@ static inline void instructUnit_setIsNewLine(InstructUnit* self, int val) { InstructUnit* New_instructUnit(uint8_t data_size); void instructUnit_deinit(InstructUnit* self); -enum Instruct pikaVM_getInstructFromAsm(char* line); +enum InstructIndex pikaVM_getInstructFromAsm(char* line); void constPool_init(ConstPool* self); void constPool_deinit(ConstPool* self); @@ -284,8 +311,19 @@ void instructArray_printAsArray(InstructArray* self); void byteCodeFrame_loadByteCode(ByteCodeFrame* self, uint8_t* bytes); void byteCodeFrame_printAsArray(ByteCodeFrame* self); void byteCodeFrame_init(ByteCodeFrame* self); +PIKA_BOOL pikaVM_registerInstructionSet(VMInstructionSet* ins_set); VMParameters* pikaVM_runByteCode(PikaObj* self, const uint8_t* bytecode); VMParameters* pikaVM_runByteCodeInconstant(PikaObj* self, uint8_t* bytecode); +Arg* pikaVM_runByteCodeReturn(PikaObj* self, + const uint8_t* bytecode, + char* returnName); +Arg* _do_pikaVM_runByteCodeReturn(PikaObj* self, + VMParameters* locals, + VMParameters* globals, + uint8_t* bytecode, + RunState* run_state, + PIKA_BOOL is_const_bytecode, + char* return_name); InstructUnit* instructArray_getNow(InstructArray* self); InstructUnit* instructArray_getNext(InstructArray* self); VMParameters* pikaVM_runSingleFile(PikaObj* self, char* filename); @@ -307,7 +345,7 @@ VMParameters* _do_pikaVM_runByteCode(PikaObj* self, void _do_byteCodeFrame_loadByteCode(ByteCodeFrame* self, uint8_t* bytes, PIKA_BOOL is_const); -Arg* __vm_get(VMState* vm, PikaObj* self, Arg* key, Arg* obj); +Arg* _vm_get(VMState* vm, PikaObj* self, Arg* key, Arg* obj); void __vm_List_append(PikaObj* self, Arg* arg); void __vm_List___init__(PikaObj* self); void __vm_Dict_set(PikaObj* self, Arg* arg, char* key); @@ -327,4 +365,9 @@ void _VMEvent_pickupEvent(void); void _pikaVM_yield(void); int _VM_lock_init(void); int _VM_is_first_lock(void); + +typedef struct { + PikaObj* lreg[PIKA_REGIST_SIZE]; +} VMLocals; + #endif diff --git a/examples/pikapython/pikapython/pikascript-core/PikaVersion.h b/examples/pikapython/pikapython/pikascript-core/PikaVersion.h index 832ed432..8aa7229c 100644 --- a/examples/pikapython/pikapython/pikascript-core/PikaVersion.h +++ b/examples/pikapython/pikapython/pikascript-core/PikaVersion.h @@ -2,4 +2,4 @@ #define PIKA_VERSION_MINOR 12 #define PIKA_VERSION_MICRO 0 -#define PIKA_EDIT_TIME "2023/02/18 20:34:52" +#define PIKA_EDIT_TIME "2023/03/08 09:54:07" diff --git a/examples/pikapython/pikapython/pikascript-core/TinyObj.c b/examples/pikapython/pikapython/pikascript-core/TinyObj.c index 1e7c34c8..50ac6201 100644 --- a/examples/pikapython/pikapython/pikascript-core/TinyObj.c +++ b/examples/pikapython/pikapython/pikascript-core/TinyObj.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -26,6 +26,7 @@ */ #include "PikaObj.h" +#include "PikaVM.h" const NativeProperty TinyObjNativeProp = {.super = NULL, .methodGroup = NULL, @@ -33,5 +34,9 @@ const NativeProperty TinyObjNativeProp = {.super = NULL, PikaObj* New_TinyObj(Args* args) { PikaObj* self = New_PikaObj(); + self->constructor = New_TinyObj; +#if PIKA_KERNAL_DEBUG_ENABLE + self->name = "TinyObj"; +#endif return self; } diff --git a/examples/pikapython/pikapython/pikascript-core/TinyObj.h b/examples/pikapython/pikapython/pikascript-core/TinyObj.h index 72d388ef..85c6ed48 100644 --- a/examples/pikapython/pikapython/pikascript-core/TinyObj.h +++ b/examples/pikapython/pikapython/pikascript-core/TinyObj.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_def.h b/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_def.h index 859096fa..bb86e6d0 100755 --- a/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_def.h +++ b/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_def.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_table.h b/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_table.h index 7bde1b37..3f607b66 100755 --- a/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_table.h +++ b/examples/pikapython/pikapython/pikascript-core/__default_filter_msg_table.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/__instruction_def.h b/examples/pikapython/pikapython/pikascript-core/__instruction_def.h index b4e1d62d..e42d0d7f 100644 --- a/examples/pikapython/pikapython/pikascript-core/__instruction_def.h +++ b/examples/pikapython/pikapython/pikascript-core/__instruction_def.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -35,20 +35,31 @@ #define def_ins(__INS_NAME) [__INS_NAME] = &VM_instruction_handler_##__INS_NAME, #endif -#if defined(__INS_COMPIRE) -#define def_ins(__INS_NAME) \ - if (0 == strncmp(ins_str, "" #__INS_NAME "", 3)) { \ - return __INS_NAME; \ +#if defined(__INS_COMPARE) +#define def_ins(__INS_NAME) \ + if (0 == strncmp(ins_str, "" #__INS_NAME "", 3)) { \ + return __INS_NAME; \ } #endif #if defined(__INS_GET_INS_STR) -#define def_ins(__INS_NAME) \ - if (__INS_NAME == instructUnit_getInstruct(self)){ \ +#define def_ins(__INS_NAME) \ + if (__INS_NAME == instructUnit_getInstructIndex(self)){ \ return ""#__INS_NAME""; \ } #endif +#if defined(__INS_OPCODE) +#define def_ins(__INS_NAME) \ + [__INS_NAME] = { \ + .handler = &VM_instruction_handler_##__INS_NAME, \ + .op_str = (const char []){#__INS_NAME}, \ + .op_str_len = sizeof(#__INS_NAME) - 1, \ + .op_idx = __INS_NAME, \ + }, +#endif + #undef __INS_ENUM #undef __INS_TABLE -#undef __INS_COMPIRE +#undef __INS_COMPARE +#undef __INS_OPCODE diff --git a/examples/pikapython/pikapython/pikascript-core/__instruction_table.cfg b/examples/pikapython/pikapython/pikascript-core/__instruction_table.cfg deleted file mode 100644 index e69baf28..00000000 --- a/examples/pikapython/pikapython/pikascript-core/__instruction_table.cfg +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript - * - * MIT License - * - * Copyright (c) 2021 GorgonMeducer ?? embedded_zhuoran@hotmail.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - -#include "__instruction_def.h" - -//! just append ins to the end, insert ins would brake the pre-compiled -//! bytecode. - -/* none */ -def_ins(NON) -/* get referance */ -def_ins(REF) -/* run function */ -def_ins(RUN) -/* string */ -def_ins(STR) -/* output */ -def_ins(OUT) -/* number */ -def_ins(NUM) -/* jump */ -def_ins(JMP) -/* jump qual zero */ -def_ins(JEZ) -/* operator */ -def_ins(OPT) -/* define */ -def_ins(DEF) -/* return */ -def_ins(RET) -/* not equal */ -def_ins(NEL) -/* delete */ -def_ins(DEL) -/* exist */ -def_ins(EST) -/* break */ -def_ins(BRK) -/* continue */ -def_ins(CTN) -/* global */ -def_ins(GLB) -/* run as */ -def_ins(RAS) -/* new */ -def_ins(NEW) -/* class */ -def_ins(CLS) -/* bytes */ -def_ins(BYT) -/* list */ -def_ins(LST) -/* import */ -def_ins(IMP) -/* try */ -def_ins(TRY) -/* not try */ -def_ins(NTR) -/* raise */ -def_ins(RIS) -/* get error code */ -def_ins(GER) -/* set error code */ -def_ins(SER) -/* dict */ -def_ins(DCT) -/* slice */ -def_ins(SLC) -/* assert */ -def_ins(ASS) -/* expect */ -def_ins(EXP) -/* jump no zero */ -def_ins(JNZ) diff --git a/examples/pikapython/pikapython/pikascript-core/__instruction_table.h b/examples/pikapython/pikapython/pikascript-core/__instruction_table.h index e69baf28..0b92630b 100755 --- a/examples/pikapython/pikapython/pikascript-core/__instruction_table.h +++ b/examples/pikapython/pikapython/pikascript-core/__instruction_table.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/__pika_ooc.h b/examples/pikapython/pikapython/pikascript-core/__pika_ooc.h index abf2e238..9fb3f133 100644 --- a/examples/pikapython/pikapython/pikascript-core/__pika_ooc.h +++ b/examples/pikapython/pikapython/pikascript-core/__pika_ooc.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataArg.c b/examples/pikapython/pikapython/pikascript-core/dataArg.c index ad28b0d8..f824df44 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataArg.c +++ b/examples/pikapython/pikapython/pikascript-core/dataArg.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -39,16 +39,16 @@ static PIKA_BOOL _arg_cache_push(Arg* self, uint32_t size) { if (PIKA_FALSE == pika_hook_arg_cache_filter(self)) { return PIKA_FALSE; } - extern PikaMemInfo pikaMemInfo; + extern PikaMemInfo g_PikaMemInfo; if (self->heap_size < PIKA_ARG_CACHE_SIZE || self->heap_size > 2 * PIKA_ARG_CACHE_SIZE) { return PIKA_FALSE; } - if (PIKA_ARG_CACHE_POOL_SIZE <= pikaMemInfo.cache_pool_top) { + if (PIKA_ARG_CACHE_POOL_SIZE <= g_PikaMemInfo.cache_pool_top) { return PIKA_FALSE; } - pikaMemInfo.cache_pool[pikaMemInfo.cache_pool_top++] = (uint8_t*)self; - pikaMemInfo.heapUsed -= mem_align(sizeof(Arg) + size); + g_PikaMemInfo.cache_pool[g_PikaMemInfo.cache_pool_top++] = (uint8_t*)self; + g_PikaMemInfo.heapUsed -= mem_align(sizeof(Arg) + size); return PIKA_TRUE; #endif } @@ -58,16 +58,16 @@ static Arg* _arg_cache_pop(uint32_t size) { return NULL; #else uint32_t req_heap_size = mem_align(sizeof(Arg) + size); - extern PikaMemInfo pikaMemInfo; + extern PikaMemInfo g_PikaMemInfo; if (req_heap_size > PIKA_ARG_CACHE_SIZE) { return NULL; } - if (!(pikaMemInfo.cache_pool_top > 0)) { + if (!(g_PikaMemInfo.cache_pool_top > 0)) { return NULL; } - --pikaMemInfo.cache_pool_top; - Arg* self = (Arg*)pikaMemInfo.cache_pool[pikaMemInfo.cache_pool_top]; - pikaMemInfo.heapUsed += mem_align(sizeof(Arg) + size); + --g_PikaMemInfo.cache_pool_top; + Arg* self = (Arg*)g_PikaMemInfo.cache_pool[g_PikaMemInfo.cache_pool_top]; + g_PikaMemInfo.heapUsed += mem_align(sizeof(Arg) + size); return self; #endif } @@ -118,15 +118,15 @@ static Arg* _arg_set_hash(Arg* self, // if (heap_size < PIKA_ARG_CACHE_SIZE) { // heap_size = PIKA_ARG_CACHE_SIZE; // } - extern PikaMemInfo pikaMemInfo; - pikaMemInfo.alloc_times++; - pikaMemInfo.alloc_times_cache++; + extern PikaMemInfo g_PikaMemInfo; + g_PikaMemInfo.alloc_times++; + g_PikaMemInfo.alloc_times_cache++; #endif if (NULL == self) { self = (Arg*)pikaMalloc(heap_size); #if PIKA_ARG_CACHE_ENABLE - extern PikaMemInfo pikaMemInfo; - pikaMemInfo.alloc_times_cache--; + extern PikaMemInfo g_PikaMemInfo; + g_PikaMemInfo.alloc_times_cache--; self->heap_size = mem_align(heap_size); #endif } @@ -318,7 +318,16 @@ Arg* arg_toStrArg(Arg* arg) { strEqu(method_store->name, "tuple")) { pika_platform_snprintf(buff, PIKA_SPRINTF_BUFF_SIZE, "", method_store->name); + return arg_newStr(buff); } + pika_platform_snprintf(buff, PIKA_SPRINTF_BUFF_SIZE, + "", + method_store->name); + return arg_newStr(buff); + } + if (argType_isConstructor(type)) { + pika_platform_snprintf(buff, PIKA_SPRINTF_BUFF_SIZE, + ""); return arg_newStr(buff); } pika_platform_snprintf(buff, PIKA_SPRINTF_BUFF_SIZE, @@ -333,7 +342,7 @@ Arg* arg_toStrArg(Arg* arg) { } if (type == ARG_TYPE_OBJECT_META) { pika_platform_snprintf(buff, PIKA_SPRINTF_BUFF_SIZE, - "", arg_getPtr(arg)); + "", arg_getPtr(arg)); return arg_newStr(buff); } return NULL; @@ -471,16 +480,37 @@ Arg* New_arg(void* voidPointer) { return NULL; } -static void _arg_refcnt_fix(Arg* self) { +void arg_refcntInc(Arg* self) { ArgType arg_type = arg_getType(self); - if (ARG_TYPE_OBJECT == arg_type) { - obj_refcntInc((PikaObj*)arg_getPtr(self)); + if (ARG_TYPE_OBJECT != arg_type) { + return; } - // if (ARG_TYPE_METHOD_OBJECT == arg_type) { - // if (NULL != methodArg_getHostObj(self)) { - // obj_refcntInc((PikaObj*)arg_getPtr(self)); - // } - // } + if (arg_getIsWeakRef(self)) { + return; + } + obj_refcntInc((PikaObj*)arg_getPtr(self)); +} + +void arg_refcntDec(Arg* self) { + ArgType arg_type = arg_getType(self); + if (ARG_TYPE_OBJECT != arg_type) { + return; + } + if (arg_getIsWeakRef(self)) { + return; + } + obj_refcntDec((PikaObj*)arg_getPtr(self)); +} + +Arg* arg_copy_content(Arg* arg_dict, Arg* arg_src) { + arg_dict = arg_setContent(arg_dict, arg_getContent(arg_src), + arg_getContentSize(arg_src)); + arg_dict = arg_setNameHash(arg_dict, arg_getNameHash(arg_src)); + pika_assert(NULL != arg_dict); + arg_setType(arg_dict, arg_getType(arg_src)); + arg_setIsKeyword(arg_dict, arg_getIsKeyword(arg_src)); + arg_setIsWeakRef(arg_dict, arg_getIsWeakRef(arg_src)); + return arg_dict; } Arg* arg_copy(Arg* arg_src) { @@ -488,14 +518,9 @@ Arg* arg_copy(Arg* arg_src) { return NULL; } pika_assert(arg_src->flag < ARG_FLAG_MAX); - _arg_refcnt_fix(arg_src); + arg_refcntInc(arg_src); Arg* arg_dict = New_arg(NULL); - arg_dict = arg_setContent(arg_dict, arg_getContent(arg_src), - arg_getContentSize(arg_src)); - arg_dict = arg_setNameHash(arg_dict, arg_getNameHash(arg_src)); - pika_assert(NULL != arg_dict); - arg_setType(arg_dict, arg_getType(arg_src)); - arg_setIsKeyword(arg_dict, arg_getIsKeyword(arg_src)); + arg_dict = arg_copy_content(arg_dict, arg_src); return arg_dict; } @@ -510,14 +535,9 @@ Arg* arg_copy_noalloc(Arg* arg_src, Arg* arg_dict) { if (arg_getSize(arg_src) > arg_getSize(arg_dict)) { return arg_copy(arg_src); } - _arg_refcnt_fix(arg_src); + arg_refcntInc(arg_src); arg_setSerialized(arg_dict, PIKA_FALSE); - arg_dict = arg_setContent(arg_dict, arg_getContent(arg_src), - arg_getContentSize(arg_src)); - arg_dict = arg_setNameHash(arg_dict, arg_getNameHash(arg_src)); - pika_assert(NULL != arg_dict); - arg_setType(arg_dict, arg_getType(arg_src)); - arg_setIsKeyword(arg_dict, arg_getIsKeyword(arg_src)); + arg_dict = arg_copy_content(arg_dict, arg_src); return arg_dict; } @@ -530,9 +550,9 @@ Arg* arg_append(Arg* self, void* new_content, size_t new_size) { if (self->heap_size > mem_align(sizeof(Arg) + old_size + new_size)) { new_arg = self; new_arg->size = old_size + new_size; - extern PikaMemInfo pikaMemInfo; - pikaMemInfo.heapUsed += mem_align(sizeof(Arg) + old_size + new_size) - - mem_align(sizeof(Arg) + old_size); + extern PikaMemInfo g_PikaMemInfo; + g_PikaMemInfo.heapUsed += mem_align(sizeof(Arg) + old_size + new_size) - + mem_align(sizeof(Arg) + old_size); } #endif if (NULL == new_arg) { diff --git a/examples/pikapython/pikapython/pikascript-core/dataArg.h b/examples/pikapython/pikapython/pikascript-core/dataArg.h index 67c363ec..1bb4e7ad 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataArg.h +++ b/examples/pikapython/pikapython/pikascript-core/dataArg.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -95,13 +95,15 @@ Arg* arg_setName(Arg* self, char* name); Arg* arg_setNameHash(Arg* self, Hash nameHash); Arg* arg_setContent(Arg* self, uint8_t* content, uint32_t size); Arg* arg_newContent(uint32_t size); +void arg_refcntInc(Arg* self); +void arg_refcntDec(Arg* self); static inline void arg_setType(Arg* self, ArgType type) { self->type = type; } static inline Hash arg_getNameHash(Arg* self) { - pika_assert(self != 0); + pika_assert(self != NULL); return self->name_hash; } @@ -158,6 +160,7 @@ uint8_t* arg_getBytes(Arg* self); size_t arg_getBytesSize(Arg* self); Arg* arg_copy(Arg* argToBeCopy); Arg* arg_copy_noalloc(Arg* argToBeCopy, Arg* argToBeCopyTo); +Arg* arg_copy_content(Arg* arg_dict, Arg* arg_src); void arg_deinit(Arg* self); @@ -269,11 +272,25 @@ static inline uint8_t argType_isCallable(ArgType type) { (type) == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR); } +static inline uint8_t argType_isConstructor(ArgType type) { + return ((type) == ARG_TYPE_METHOD_CONSTRUCTOR || + (type) == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR); +} + static inline uint8_t argType_isNative(ArgType type) { return ((type) == ARG_TYPE_METHOD_NATIVE || (type) == ARG_TYPE_METHOD_NATIVE_CONSTRUCTOR); } +#define arg_isObject(__self) \ + ((__self != NULL) && (argType_isObject(arg_getType(__self)))) +#define arg_isCallable(__self) \ + ((__self != NULL) && (argType_isCallable(arg_getType(__self)))) +#define arg_isConstructor(__self) \ + ((__self != NULL) && (argType_isConstructor(arg_getType(__self)))) +#define arg_isNative(__self) \ + ((__self != NULL) && (argType_isNative(arg_getType(__self)))) + #define arg_newReg(__name, __size) \ Arg __name = {0}; \ uint8_t __##__name##_buff[__size] = {0}; \ diff --git a/examples/pikapython/pikapython/pikascript-core/dataArgs.c b/examples/pikapython/pikapython/pikascript-core/dataArgs.c index 72476254..8b14a0e0 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataArgs.c +++ b/examples/pikapython/pikapython/pikascript-core/dataArgs.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -78,9 +78,10 @@ PIKA_RES args_setPtr(Args* self, char* name, void* argPointer) { PIKA_RES args_setRef(Args* self, char* name, void* argPointer) { PIKA_RES errCode = PIKA_RES_OK; - Arg* argNew = New_arg(NULL); - argNew = arg_setRef(argNew, name, argPointer); - args_setArg(self, argNew); + Arg* aNewRef = New_arg(NULL); + aNewRef = arg_setRef(aNewRef, name, argPointer); + // pikaGC_enable(arg_getPtr(aNewRef)); + args_setArg(self, aNewRef); return errCode; } @@ -311,7 +312,7 @@ int32_t args_isArgExist(Args* self, char* name) { return 0; } -PIKA_RES __updateArg(Args* self, Arg* argNew) { +PIKA_RES _updateArg(Args* self, Arg* argNew) { pika_assert(NULL != self); pika_assert(NULL != argNew); LinkNode* nodeToUpdate = NULL; @@ -336,12 +337,10 @@ PIKA_RES __updateArg(Args* self, Arg* argNew) { } arg_deinitHeap((Arg*)nodeToUpdate); - - nodeToUpdate = (LinkNode*)arg_setContent( - (Arg*)nodeToUpdate, arg_getContent(argNew), arg_getSize(argNew)); - pika_assert(NULL != nodeToUpdate); - arg_setType((Arg*)nodeToUpdate, arg_getType(argNew)); + + nodeToUpdate = (LinkNode*)arg_copy_content((Arg*)nodeToUpdate, argNew); + // update privior link, because arg_getContent would free origin pointer if (NULL == priorNode) { self->firstNode = nodeToUpdate; @@ -363,7 +362,7 @@ exit: PIKA_RES args_setArg(Args* self, Arg* arg) { pika_assert(NULL != self); pika_assert(NULL != arg); - if (PIKA_RES_OK == __updateArg(self, arg)) { + if (PIKA_RES_OK == _updateArg(self, arg)) { return PIKA_RES_OK; } args_pushArg(self, arg); @@ -442,8 +441,8 @@ Arg* args_getArgByIndex(Args* self, int index) { } PIKA_RES args_foreach(Args* self, - int32_t (*eachHandle)(Arg* argEach, Args* context), - Args* context) { + int32_t (*eachHandle)(Arg* argEach, void* context), + void* context) { if (NULL == self->firstNode) { return PIKA_RES_OK; } diff --git a/examples/pikapython/pikapython/pikascript-core/dataArgs.h b/examples/pikapython/pikapython/pikascript-core/dataArgs.h index 36683939..33897c0c 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataArgs.h +++ b/examples/pikapython/pikapython/pikascript-core/dataArgs.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -107,8 +107,8 @@ PIKA_RES args_setPtrWithType(Args* self, ArgType type, void* objPtr); PIKA_RES args_foreach(Args* self, - int32_t (*eachHandle)(Arg* argEach, Args* context), - Args* context); + int32_t (*eachHandle)(Arg* argEach, void* context), + void* context); char* args_getBuff(Args* self, int32_t size); PIKA_RES args_pushArg(Args* self, Arg* arg); diff --git a/examples/pikapython/pikapython/pikascript-core/dataLink.c b/examples/pikapython/pikapython/pikascript-core/dataLink.c index 52e9d3e9..af43eeaf 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataLink.c +++ b/examples/pikapython/pikapython/pikascript-core/dataLink.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -30,7 +30,7 @@ #include "dataLinkNode.h" #include "dataMemory.h" -void __link_deinit_pyload(Link* self) { +void _link_deinit_pyload(Link* self) { LinkNode* nowNode = self->firstNode; while (NULL != nowNode) { LinkNode* nodeNext = (LinkNode*)arg_getNext((Arg*)nowNode); @@ -42,12 +42,12 @@ void __link_deinit_pyload(Link* self) { void link_deinit(Link* self) { pika_assert(self != NULL); - __link_deinit_pyload(self); + _link_deinit_pyload(self); pikaFree(self, sizeof(Link)); } void link_deinit_stack(Link* self) { - __link_deinit_pyload(self); + _link_deinit_pyload(self); } void link_addNode(Link* self, void* content) { @@ -59,7 +59,7 @@ void link_addNode(Link* self, void* content) { arg_setNext((Arg*)content, (Arg*)secondNode); } -static void __link_removeNode(Link* self, +static void _link_removeNode(Link* self, void* content, uint8_t is_deinit_node) { LinkNode* nodeToDelete = NULL; @@ -99,11 +99,11 @@ exit: } void link_removeNode(Link* self, void* content) { - __link_removeNode(self, content, 1); + _link_removeNode(self, content, 1); } void link_removeNode_notDeinitNode(Link* self, void* content) { - __link_removeNode(self, content, 0); + _link_removeNode(self, content, 0); } int32_t link_getSize(Link* self) { diff --git a/examples/pikapython/pikapython/pikascript-core/dataLink.h b/examples/pikapython/pikapython/pikascript-core/dataLink.h index 1f1ede39..5f723c3d 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataLink.h +++ b/examples/pikapython/pikapython/pikascript-core/dataLink.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataLinkNode.c b/examples/pikapython/pikapython/pikascript-core/dataLinkNode.c index b6f0c4d5..e284da0b 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataLinkNode.c +++ b/examples/pikapython/pikapython/pikascript-core/dataLinkNode.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataLinkNode.h b/examples/pikapython/pikapython/pikascript-core/dataLinkNode.h index 63b648f3..41a852ad 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataLinkNode.h +++ b/examples/pikapython/pikapython/pikascript-core/dataLinkNode.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataMemory.c b/examples/pikapython/pikapython/pikascript-core/dataMemory.c index c4af0750..6483b301 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataMemory.c +++ b/examples/pikapython/pikapython/pikascript-core/dataMemory.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -29,7 +29,7 @@ #include "dataMemory.h" #include "PikaPlatform.h" -volatile PikaMemInfo pikaMemInfo = {0}; +volatile PikaMemInfo g_PikaMemInfo = {0}; void* pikaMalloc(uint32_t size) { /* pika memory lock */ @@ -43,15 +43,16 @@ void* pikaMalloc(uint32_t size) { size = mem_align(size); #endif - pikaMemInfo.heapUsed += size; - if (pikaMemInfo.heapUsedMax < pikaMemInfo.heapUsed) { - pikaMemInfo.heapUsedMax = pikaMemInfo.heapUsed; + g_PikaMemInfo.heapUsed += size; + if (g_PikaMemInfo.heapUsedMax < g_PikaMemInfo.heapUsed) { + g_PikaMemInfo.heapUsedMax = g_PikaMemInfo.heapUsed; } pika_platform_disable_irq_handle(); void* mem = pika_user_malloc(size); pika_platform_enable_irq_handle(); if (NULL == mem) { - pika_platform_printf("Error: No heap space! Please reset the device.\r\n"); + pika_platform_printf( + "Error: No heap space! Please reset the device.\r\n"); while (1) { } } @@ -72,20 +73,20 @@ void pikaFree(void* mem, uint32_t size) { pika_platform_disable_irq_handle(); pika_user_free(mem, size); pika_platform_enable_irq_handle(); - pikaMemInfo.heapUsed -= size; + g_PikaMemInfo.heapUsed -= size; } uint32_t pikaMemNow(void) { - return pikaMemInfo.heapUsed; + return g_PikaMemInfo.heapUsed; // return 0; } uint32_t pikaMemMax(void) { - return pikaMemInfo.heapUsedMax; + return g_PikaMemInfo.heapUsedMax; } void pikaMemMaxReset(void) { - pikaMemInfo.heapUsedMax = 0; + g_PikaMemInfo.heapUsedMax = 0; } uint32_t pool_getBlockIndex_byMemSize(Pool* pool, uint32_t size) { @@ -137,7 +138,7 @@ void pool_printBlocks(Pool* pool, uint32_t size_min, uint32_t size_max) { break; } pika_platform_printf("0x%x\t: 0x%d", i * pool->aline, - (i + 15) * pool->aline); + (i + 15) * pool->aline); for (uint32_t j = i; j < i + 16; j += 4) { if (is_end) { break; @@ -307,9 +308,10 @@ void mem_pool_init(void) { void _mem_cache_deinit(void) { #if PIKA_ARG_CACHE_ENABLE - while (pikaMemInfo.cache_pool_top) { - pika_user_free(pikaMemInfo.cache_pool[pikaMemInfo.cache_pool_top - 1], 0); - pikaMemInfo.cache_pool_top--; + while (g_PikaMemInfo.cache_pool_top) { + pika_user_free( + g_PikaMemInfo.cache_pool[g_PikaMemInfo.cache_pool_top - 1], 0); + g_PikaMemInfo.cache_pool_top--; } #endif } diff --git a/examples/pikapython/pikapython/pikascript-core/dataMemory.h b/examples/pikapython/pikapython/pikascript-core/dataMemory.h index fda21859..e3f99650 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataMemory.h +++ b/examples/pikapython/pikapython/pikascript-core/dataMemory.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataQueue.c b/examples/pikapython/pikapython/pikascript-core/dataQueue.c index 88d72093..fec57eda 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataQueue.c +++ b/examples/pikapython/pikapython/pikascript-core/dataQueue.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataQueue.h b/examples/pikapython/pikapython/pikascript-core/dataQueue.h index 28ad28c9..f43c8ff1 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataQueue.h +++ b/examples/pikapython/pikapython/pikascript-core/dataQueue.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataQueueObj.c b/examples/pikapython/pikapython/pikascript-core/dataQueueObj.c index ec07f59f..f42626d7 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataQueueObj.c +++ b/examples/pikapython/pikapython/pikascript-core/dataQueueObj.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataQueueObj.h b/examples/pikapython/pikapython/pikascript-core/dataQueueObj.h index 78531602..fffa258d 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataQueueObj.h +++ b/examples/pikapython/pikapython/pikascript-core/dataQueueObj.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataStack.c b/examples/pikapython/pikapython/pikascript-core/dataStack.c index cca22627..9be4a666 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataStack.c +++ b/examples/pikapython/pikapython/pikascript-core/dataStack.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -101,9 +101,9 @@ void stack_pushPyload(Stack* stack, "OverflowError: pika VM stack overflow, please use bigger " "PIKA_STACK_BUFF_SIZE\r\n"); pika_platform_printf("Info: stack size request: %d\r\n", - (int)stack_size_after_push); + (int)stack_size_after_push); pika_platform_printf("Info: stack size now: %d\r\n", - (int)stack->stack_totle_size); + (int)stack->stack_totle_size); while (1) { } } @@ -113,7 +113,7 @@ void stack_pushPyload(Stack* stack, } else { pika_platform_memcpy(top, in, sizeof(Arg)); pika_platform_memcpy(top->content, ((Arg*)in)->_.buffer, - size - sizeof(Arg)); + size - sizeof(Arg)); /* transfer to serialized form */ arg_setSerialized(top, PIKA_TRUE); } @@ -138,9 +138,7 @@ static int32_t _stack_pushArg(Stack* stack, Arg* arg, PIKA_BOOL is_alloc) { size = (size + 4 - 1) & ~(4 - 1); #endif /* add ref_cnt to keep object in stack */ - if (argType_isObject(arg_getType(arg))) { - obj_refcntInc((PikaObj*)arg_getPtr(arg)); - } + arg_refcntInc(arg); if (arg_isSerialized(arg)) { is_big_arg = PIKA_TRUE; @@ -152,7 +150,8 @@ static int32_t _stack_pushArg(Stack* stack, Arg* arg, PIKA_BOOL is_alloc) { stack_pushPyload(stack, (uint8_t*)&arg, sizeof(Arg*), PIKA_TRUE); } else { stack_pushSize(stack, size); - stack_pushPyload(stack, (uint8_t*)arg, size, (PIKA_BOOL)arg_isSerialized(arg)); + stack_pushPyload(stack, (uint8_t*)arg, size, + (PIKA_BOOL)arg_isSerialized(arg)); } if (is_big_arg) { @@ -168,6 +167,9 @@ static int32_t _stack_pushArg(Stack* stack, Arg* arg, PIKA_BOOL is_alloc) { int32_t stack_pushArg(Stack* stack, Arg* arg) { pika_assert(arg != NULL); + if (arg_isObject(arg)) { + pika_assert(obj_checkAlive(arg_getPtr(arg))); + } if (arg_isSerialized(arg)) { return _stack_pushArg(stack, arg, PIKA_TRUE); } @@ -202,11 +204,8 @@ Arg* _stack_popArg(Stack* stack, Arg* arg_dict, PIKA_BOOL is_alloc) { } } - ArgType type = arg_getType(arg); /* decrase ref_cnt */ - if (argType_isObject(type)) { - obj_refcntDec((PikaObj*)arg_getPtr(arg)); - } + arg_refcntDec(arg); pika_assert(arg->flag < ARG_FLAG_MAX); return arg; } diff --git a/examples/pikapython/pikapython/pikascript-core/dataStack.h b/examples/pikapython/pikapython/pikascript-core/dataStack.h index 4290cd0e..a0c14194 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataStack.h +++ b/examples/pikapython/pikapython/pikascript-core/dataStack.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataString.c b/examples/pikapython/pikapython/pikascript-core/dataString.c index f44874ac..3826a5b2 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataString.c +++ b/examples/pikapython/pikapython/pikascript-core/dataString.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -122,6 +122,7 @@ size_t strGetSize(char* pData) { return strlen(pData); } + char* strPointToLastToken(char* strIn, char sign) { if (!strIsContain(strIn, sign)) { return strIn; diff --git a/examples/pikapython/pikapython/pikascript-core/dataString.h b/examples/pikapython/pikapython/pikascript-core/dataString.h index 38dfeedf..f552059e 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataString.h +++ b/examples/pikapython/pikapython/pikascript-core/dataString.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataStrs.c b/examples/pikapython/pikapython/pikascript-core/dataStrs.c index e2ea2bd2..13d7ec80 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataStrs.c +++ b/examples/pikapython/pikapython/pikascript-core/dataStrs.c @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/dataStrs.h b/examples/pikapython/pikapython/pikascript-core/dataStrs.h index 3d1bdb97..b09e805e 100644 --- a/examples/pikapython/pikapython/pikascript-core/dataStrs.h +++ b/examples/pikapython/pikapython/pikascript-core/dataStrs.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * diff --git a/examples/pikapython/pikapython/pikascript-core/pika_config_valid.h b/examples/pikapython/pikapython/pikascript-core/pika_config_valid.h index 7ce1862c..00c79d2b 100644 --- a/examples/pikapython/pikapython/pikascript-core/pika_config_valid.h +++ b/examples/pikapython/pikapython/pikascript-core/pika_config_valid.h @@ -1,6 +1,6 @@ /* - * This file is part of the PikaScript project. - * http://github.com/pikastech/pikascript + * This file is part of the PikaPython project. + * http://github.com/pikastech/pikapython * * MIT License * @@ -73,6 +73,18 @@ #define PIKA_SHELL_FILTER_ENABLE 0 #endif + #ifdef PIKA_TYPE_FULL_FEATURE_ENABLE + #define PIKA_TYPE_FULL_FEATURE_ENABLE 0 + #endif + + #ifndef PIKA_EVENT_THREAD_ENABLE + #define PIKA_EVENT_THREAD_ENABLE 0 + #endif + + #ifndef PIKA_GC_MARK_SWEEP_ENABLE + #define PIKA_GC_MARK_SWEEP_ENABLE 0 + #endif + #endif /* default optimize */ @@ -298,6 +310,18 @@ #define PIKA_INSTRUCT_HOOK_PERIOD 50 #endif + #ifndef PIKA_INSTRUCT_YIELD_PERIOD + #define PIKA_INSTRUCT_YIELD_PERIOD 1 + #endif + + #ifndef PIKA_INSTRUCT_EXTENSION_ENABLE + #define PIKA_INSTRUCT_EXTENSION_ENABLE 1 + #endif + + #ifndef PIKA_INSTRUCT_SIGNATURE_DICT_COUNT + #define PIKA_INSTRUCT_SIGNATURE_DICT_COUNT 1 + #endif + #ifndef PIKA_EXEC_ENABLE #define PIKA_EXEC_ENABLE 1 #endif @@ -362,6 +386,10 @@ #ifndef PIKA_EVENT_LIST_SIZE #define PIKA_EVENT_LIST_SIZE 16 #endif + + #ifndef PIKA_EVENT_PICKUP_MAX + #define PIKA_EVENT_PICKUP_MAX 2 + #endif #ifndef PIKA_BYTECODE_ONLY_ENABLE #define PIKA_BYTECODE_ONLY_ENABLE 0 @@ -403,6 +431,26 @@ #define PIKA_THREAD_TICK 50 #endif + #ifndef PIKA_TYPE_FULL_FEATURE_ENABLE + #define PIKA_TYPE_FULL_FEATURE_ENABLE 1 + #endif + + #ifndef PIKA_EVENT_THREAD_ENABLE + #define PIKA_EVENT_THREAD_ENABLE 1 + #endif + + #ifndef PIKA_GC_MARK_SWEEP_ENABLE + #define PIKA_GC_MARK_SWEEP_ENABLE 0 + #endif + + #ifndef PIKA_GC_MARK_SWEEP_THRESHOLD + #define PIKA_GC_MARK_SWEEP_THRESHOLD 20 + #endif + + #ifndef PIKA_KERNAL_DEBUG_ENABLE + #define PIKA_KERNAL_DEBUG_ENABLE 0 + #endif + /* configuration validation */ #endif diff --git a/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_GPIO.c b/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_GPIO.c index 65d97a61..c4556c76 100755 --- a/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_GPIO.c +++ b/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_GPIO.c @@ -151,8 +151,8 @@ void PikaStdDevice_GPIO_platformRead(PikaObj* self) { void PikaStdDevice_GPIO_setCallBack(PikaObj* self, Arg* eventCallback, int filter) { - pika_dev* dev = _get_dev(self); #if PIKA_EVENT_ENABLE + pika_dev* dev = _get_dev(self); _PikaStdDevice_setCallBack(self, eventCallback, (uintptr_t)dev); /* regist event to pika_hal */ pika_hal_GPIO_config cfg_cb = {0}; diff --git a/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_UART.c b/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_UART.c index af27e504..374d04fa 100755 --- a/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_UART.c +++ b/examples/pikapython/pikapython/pikascript-lib/PikaStdDevice/PikaStdDevice_UART.c @@ -182,8 +182,8 @@ void PikaStdDevice_UART_platformWriteBytes(PikaObj* self) { void PikaStdDevice_UART_setCallBack(PikaObj* self, Arg* eventCallBack, int filter) { - pika_dev* dev = _get_dev(self); #if PIKA_EVENT_ENABLE + pika_dev* dev = _get_dev(self); _PikaStdDevice_setCallBack(self, eventCallBack, (uintptr_t)dev); /* regist event to pika_hal */ pika_hal_UART_config cfg_cb = {0}; diff --git a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_Dict.c b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_Dict.c index 63447c25..a9712a90 100644 --- a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_Dict.c +++ b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_Dict.c @@ -8,12 +8,14 @@ #include "dataStrs.h" Arg* PikaStdData_Dict_get(PikaObj* self, char* key) { + pika_assert_obj_alive(self); PikaDict* dict = obj_getPtr(self, "dict"); Arg* res = pikaDict_getArg(dict, key); if (NULL == res) { obj_setErrorCode(self, PIKA_RES_ERR_RUNTIME_ERROR); __platform_printf("KeyError: %s\n", key); } + pika_assert_arg_alive(res); return arg_copy(res); } @@ -271,7 +273,7 @@ void PikaStdData_Dict_update(PikaObj* self, PikaObj* other) { const uint8_t bytes[] = { - 0x40, 0x00, 0x00, 0x00,/* instruct array size */ + 0x40, 0x00, 0x00, 0x00, /* instruct array size */ 0x10, 0x81, 0x01, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x04, 0x0d, 0x00, 0x00, 0x82, 0x11, 0x00, 0x00, 0x04, 0x1e, 0x00, 0x00, 0x0d, 0x1e, 0x00, 0x00, 0x07, 0x24, 0x00, 0x11, 0x81, @@ -279,7 +281,7 @@ void PikaStdData_Dict_update(PikaObj* self, PikaObj* other) { 0x21, 0x01, 0x1e, 0x00, 0x11, 0x1d, 0x00, 0x00, 0x01, 0x02, 0x2c, 0x00, 0x01, 0x04, 0x26, 0x00, 0x00, 0x86, 0x38, 0x00, 0x00, 0x8c, 0x0d, 0x00, /* instruct array */ - 0x3b, 0x00, 0x00, 0x00, /* const pool size */ + 0x3b, 0x00, 0x00, 0x00, /* const pool size */ 0x00, 0x40, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, 0x6c, 0x30, 0x00, 0x24, 0x6c, 0x30, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, 0x00, diff --git a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_String.c b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_String.c index a8d7391d..6560424c 100644 --- a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_String.c +++ b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdData_String.c @@ -1,11 +1,12 @@ #include "PikaStdData_String.h" #include "PikaStdData_List.h" #include "PikaStdData_String_Util.h" -#include "dataStrs.h" +#include "PikaStdLib_SysObj.h" #include "PikaVM.h" +#include "dataStrs.h" char* _strlwr(char* str); -static int string_len(char* str); +int strGetSizeUtf8(char* str); Arg* PikaStdData_String___iter__(PikaObj* self) { obj_setInt(self, "__iter_i", 0); @@ -69,7 +70,7 @@ Arg* PikaStdData_String___next__(PikaObj* self) { static int _str_get(char* str, int key_i, char* char_buff) { uint16_t len = strGetSize(str); if (key_i < 0) { - key_i = string_len(str) + key_i; + key_i = strGetSizeUtf8(str) + key_i; } #if PIKA_STRING_UTF8_ENABLE return _utf8_get(str, len, key_i, char_buff); @@ -84,16 +85,6 @@ static int _str_get(char* str, int key_i, char* char_buff) { char* string_slice(Args* outBuffs, char* str, int start, int end) { char* res = args_getBuff(outBuffs, strGetSize(str)); - if (start < 0) { - start += string_len(str); - } - /* magic code, to the end */ - if (end == VM_PC_EXIT) { - end = string_len(str); - } - if (end < 0) { - end += string_len(str); - } for (int i = start; i < end; i++) { char char_buff[5] = {0}; int r = _str_get(str, i, char_buff); @@ -276,7 +267,7 @@ PikaObj* PikaStdData_String_split(PikaObj* self, char* s) { return list; } -static int string_len(char* str) { +int strGetSizeUtf8(char* str) { #if PIKA_STRING_UTF8_ENABLE int n = _utf8_strlen(str, -1); return n; @@ -287,7 +278,7 @@ static int string_len(char* str) { int PikaStdData_String___len__(PikaObj* self) { char* str = obj_getStr(self, "str"); - int n = string_len(str); + int n = strGetSizeUtf8(str); if (n < 0) { obj_setErrorCode(self, __LINE__); __platform_printf("Error. Internal error(%d)\r\n", __LINE__); @@ -823,3 +814,47 @@ char* PikaStdData_String_format(PikaObj* self, PikaTuple* vars) { /* 'test{}'.format(123) */ return NULL; } + +char* PikaStdData_String_join(PikaObj* self, Arg* val) { + PikaObj* context = newNormalObj(New_PikaStdLib_SysObj); + obj_setArg(context, "@val", val); + obj_setStr(context, "@str", obj_getStr(self, "str")); + /* clang-format off */ + PIKA_PYTHON( + @res_join = "" + @num = len(@val) + for i in range(@num): + @res_join += @val[i] + if i != @num - 1: + @res_join += @str + + ) + /* clang-format on */ + const uint8_t bytes[] = { + 0x84, 0x00, 0x00, 0x00, /* instruct array size */ + 0x00, 0x83, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x10, 0x81, 0x0b, 0x00, + 0x00, 0x02, 0x10, 0x00, 0x00, 0x04, 0x14, 0x00, 0x20, 0x81, 0x14, 0x00, + 0x10, 0x02, 0x19, 0x00, 0x00, 0x02, 0x1f, 0x00, 0x00, 0x04, 0x24, 0x00, + 0x00, 0x82, 0x28, 0x00, 0x00, 0x04, 0x35, 0x00, 0x00, 0x0d, 0x35, 0x00, + 0x00, 0x07, 0x37, 0x00, 0x11, 0x81, 0x01, 0x00, 0x31, 0x01, 0x0b, 0x00, + 0x31, 0x01, 0x35, 0x00, 0x21, 0x1d, 0x00, 0x00, 0x11, 0x02, 0x00, 0x00, + 0x01, 0x08, 0x39, 0x00, 0x01, 0x04, 0x01, 0x00, 0x11, 0x81, 0x35, 0x00, + 0x21, 0x01, 0x14, 0x00, 0x21, 0x05, 0x3b, 0x00, 0x11, 0x08, 0x3d, 0x00, + 0x01, 0x08, 0x3f, 0x00, 0x01, 0x07, 0x3b, 0x00, 0x12, 0x81, 0x01, 0x00, + 0x22, 0x01, 0x42, 0x00, 0x12, 0x02, 0x00, 0x00, 0x02, 0x08, 0x39, 0x00, + 0x02, 0x04, 0x01, 0x00, 0x00, 0x86, 0x47, 0x00, 0x00, 0x8c, 0x24, 0x00, + /* instruct array */ + 0x4a, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x40, 0x72, 0x65, 0x73, 0x5f, 0x6a, 0x6f, 0x69, 0x6e, 0x00, 0x40, + 0x76, 0x61, 0x6c, 0x00, 0x6c, 0x65, 0x6e, 0x00, 0x40, 0x6e, 0x75, 0x6d, + 0x00, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, + 0x24, 0x6c, 0x30, 0x00, 0x24, 0x6c, 0x30, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, + 0x78, 0x74, 0x5f, 0x5f, 0x00, 0x69, 0x00, 0x32, 0x00, 0x2b, 0x00, 0x31, + 0x00, 0x2d, 0x00, 0x21, 0x3d, 0x00, 0x40, 0x73, 0x74, 0x72, 0x00, 0x2d, + 0x31, 0x00, /* const pool */ + }; + pikaVM_runByteCode(context, (uint8_t*)bytes); + char* sRes = obj_cacheStr(self, obj_getStr(context, "@res_join")); + obj_deinit(context); + return sRes; +} diff --git a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c index ee226e2d..30204985 100644 --- a/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c +++ b/examples/pikapython/pikapython/pikascript-lib/PikaStdLib/PikaStdLib_SysObj.c @@ -57,6 +57,12 @@ Arg* PikaStdLib_SysObj_type(PikaObj* self, Arg* arg) { if (clsptr == New_PikaStdData_Tuple) { return arg_copy(obj_getMethodArg(self, "tuple")); } +#if PIKA_TYPE_FULL_FEATURE_ENABLE + Arg* aMethod = obj_getArg(obj, "__class__"); + if (NULL != aMethod) { + return arg_copy(aMethod); + } +#endif return arg_newStr(""); } if (ARG_TYPE_OBJECT_META == type) { @@ -65,9 +71,6 @@ Arg* PikaStdLib_SysObj_type(PikaObj* self, Arg* arg) { if (ARG_TYPE_BYTES == type) { return arg_newStr(""); } - if (ARG_TYPE_METHOD_NATIVE == type) { - return arg_newStr(""); - } if (ARG_TYPE_METHOD_OBJECT == type) { return arg_newStr(""); } @@ -77,7 +80,7 @@ Arg* PikaStdLib_SysObj_type(PikaObj* self, Arg* arg) { if (ARG_TYPE_NONE == type) { return arg_newStr(""); } - return arg_newNull(); + return arg_newStr(""); } pika_float PikaStdLib_SysObj_float(PikaObj* self, Arg* arg) { @@ -166,65 +169,64 @@ char* PikaStdLib_SysObj_str(PikaObj* self, Arg* arg) { Arg* PikaStdLib_SysObj_iter(PikaObj* self, Arg* arg) { /* object */ - PIKA_BOOL is_temp = PIKA_FALSE; - PikaObj* arg_obj = _arg_to_obj(arg, &is_temp); - NewFun _clsptr = (NewFun)arg_obj->constructor; + PIKA_BOOL bIsTemp = PIKA_FALSE; + PikaObj* oArg = _arg_to_obj(arg, &bIsTemp); + NewFun _clsptr = (NewFun)oArg->constructor; if (_clsptr == New_PikaStdLib_RangeObj) { /* found RangeObj, return directly */ return arg_copy(arg); } - // pikaVM_runAsm(arg_obj, - // "B0\n" - // "0 RUN __iter__\n" - // "0 OUT __res\n"); + /* clang-format off */ + PIKA_PYTHON( + @res_iter = __iter__() + ) + /* clang-format on */ const uint8_t bytes[] = { 0x08, 0x00, 0x00, 0x00, /* instruct array size */ 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x0a, 0x00, /* instruct array */ - 0x10, 0x00, 0x00, 0x00, /* const pool size */ - 0x00, 0x5f, 0x5f, 0x69, 0x74, 0x65, 0x72, 0x5f, - 0x5f, 0x00, 0x5f, 0x5f, 0x72, 0x65, 0x73, 0x00, /* const pool */ + 0x14, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x5f, 0x5f, 0x69, 0x74, 0x65, 0x72, 0x5f, 0x5f, 0x00, 0x40, + 0x72, 0x65, 0x73, 0x5f, 0x69, 0x74, 0x65, 0x72, 0x00, /* const pool */ }; - pikaVM_runByteCode(arg_obj, (uint8_t*)bytes); - Arg* res = arg_copy(args_getArg(arg_obj->list, "__res")); - obj_removeArg(arg_obj, "__res"); - if (is_temp) { - obj_refcntDec(arg_obj); + Arg* res = pikaVM_runByteCodeReturn(oArg, (uint8_t*)bytes, "@res_iter"); + if (bIsTemp) { + obj_refcntDec(oArg); } return res; } Arg* PikaStdLib_SysObj_range(PikaObj* self, PikaTuple* ax) { /* set template arg to create rangeObj */ - Arg* obj_arg = arg_newDirectObj(New_PikaStdLib_RangeObj); - PikaObj* range_obj = arg_getPtr(obj_arg); - RangeData range_data = {0}; + Arg* aRangeObj = arg_newDirectObj(New_PikaStdLib_RangeObj); + PikaObj* oRangeObj = arg_getPtr(aRangeObj); + RangeData tRangeData = {0}; if (pikaTuple_getSize(ax) == 1) { int start = 0; int end = arg_getInt(pikaTuple_getArg(ax, 0)); - range_data.start = start; - range_data.end = end; - range_data.step = 1; + tRangeData.start = start; + tRangeData.end = end; + tRangeData.step = 1; } else if (pikaTuple_getSize(ax) == 2) { int start = arg_getInt(pikaTuple_getArg(ax, 0)); int end = arg_getInt(pikaTuple_getArg(ax, 1)); - range_data.start = start; - range_data.end = end; - range_data.step = 1; + tRangeData.start = start; + tRangeData.end = end; + tRangeData.step = 1; } else if (pikaTuple_getSize(ax) == 3) { int start = arg_getInt(pikaTuple_getArg(ax, 0)); int end = arg_getInt(pikaTuple_getArg(ax, 1)); int step = arg_getInt(pikaTuple_getArg(ax, 2)); - range_data.start = start; - range_data.end = end; - range_data.step = step; + tRangeData.start = start; + tRangeData.end = end; + tRangeData.step = step; } - range_data.i = range_data.start; - obj_setStruct(range_obj, "_", range_data); - return obj_arg; + tRangeData.i = tRangeData.start; + obj_setStruct(oRangeObj, "_", tRangeData); + return aRangeObj; } Arg* PikaStdLib_SysObj___getitem__(PikaObj* self, Arg* obj, Arg* key) { - return __vm_get(NULL, self, key, obj); + return _vm_get(NULL, self, key, obj); } Arg* PikaStdLib_SysObj___setitem__(PikaObj* self, @@ -288,27 +290,27 @@ int PikaStdLib_SysObj_len(PikaObj* self, Arg* arg) { return arg_getBytesSize(arg); } - if (argType_isObject(arg_getType(arg))) { + if (arg_isObject(arg)) { PikaObj* arg_obj = arg_getPtr(arg); Arg* method_arg = obj_getMethodArg(arg_obj, "__len__"); if (NULL != method_arg) { arg_deinit(method_arg); - + obj_removeArg(arg_obj, "@res_len"); /* clang-format off */ - PIKA_PYTHON( - __res = __len__() - ) + PIKA_PYTHON( + @res_len = __len__() + ) /* clang-format on */ const uint8_t bytes[] = { 0x08, 0x00, 0x00, 0x00, /* instruct array size */ 0x00, 0x82, 0x01, 0x00, 0x00, 0x04, 0x09, 0x00, /* instruct array */ - 0x0f, 0x00, 0x00, 0x00, /* const pool size */ - 0x00, 0x5f, 0x5f, 0x6c, 0x65, 0x6e, 0x5f, 0x5f, 0x00, - 0x5f, 0x5f, 0x72, 0x65, 0x73, 0x00, /* const pool */ + 0x12, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x5f, 0x5f, 0x6c, 0x65, 0x6e, 0x5f, 0x5f, 0x00, 0x40, + 0x72, 0x65, 0x73, 0x5f, 0x6c, 0x65, 0x6e, 0x00, /* const pool */ }; pikaVM_runByteCode(arg_obj, (uint8_t*)bytes); - return obj_getInt(arg_obj, "__res"); + return obj_getInt(arg_obj, "@res_len"); } } @@ -324,33 +326,33 @@ Arg* PikaStdLib_SysObj_list(PikaObj* self, PikaTuple* val) { obj_setArg(self, "__list", in); /* clang-format off */ PIKA_PYTHON( - __res = [] + @res_list = [] for __item in __list: - __res.append(__item) + @res_list.append(__item) del __item del __list + ) /* clang-format on */ const uint8_t bytes[] = { 0x3c, 0x00, 0x00, 0x00, /* instruct array size */ - 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x10, 0x81, 0x07, - 0x00, 0x00, 0x02, 0x0e, 0x00, 0x00, 0x04, 0x13, 0x00, 0x00, 0x82, - 0x17, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x0d, 0x24, 0x00, 0x00, - 0x07, 0x2b, 0x00, 0x11, 0x81, 0x24, 0x00, 0x01, 0x02, 0x2d, 0x00, - 0x00, 0x86, 0x3a, 0x00, 0x00, 0x8c, 0x13, 0x00, 0x00, 0x8c, 0x24, - 0x00, 0x00, 0x8c, 0x07, 0x00, + 0x00, 0x95, 0x00, 0x00, 0x00, 0x04, 0x01, 0x00, 0x10, 0x81, 0x0b, + 0x00, 0x00, 0x02, 0x12, 0x00, 0x00, 0x04, 0x17, 0x00, 0x00, 0x82, + 0x1b, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x0d, 0x28, 0x00, 0x00, + 0x07, 0x2f, 0x00, 0x11, 0x81, 0x28, 0x00, 0x01, 0x02, 0x31, 0x00, + 0x00, 0x86, 0x42, 0x00, 0x00, 0x8c, 0x17, 0x00, 0x00, 0x8c, 0x28, + 0x00, 0x00, 0x8c, 0x0b, 0x00, /* instruct array */ - 0x3d, 0x00, 0x00, 0x00, /* const pool size */ - 0x00, 0x5f, 0x5f, 0x72, 0x65, 0x73, 0x00, 0x5f, 0x5f, 0x6c, 0x69, - 0x73, 0x74, 0x00, 0x69, 0x74, 0x65, 0x72, 0x00, 0x24, 0x6c, 0x30, - 0x00, 0x24, 0x6c, 0x30, 0x2e, 0x5f, 0x5f, 0x6e, 0x65, 0x78, 0x74, - 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x00, 0x32, - 0x00, 0x5f, 0x5f, 0x72, 0x65, 0x73, 0x2e, 0x61, 0x70, 0x70, 0x65, - 0x6e, 0x64, 0x00, 0x2d, 0x31, 0x00, - /* const pool */ + 0x45, 0x00, 0x00, 0x00, /* const pool size */ + 0x00, 0x40, 0x72, 0x65, 0x73, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x00, + 0x5f, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x00, 0x69, 0x74, 0x65, 0x72, + 0x00, 0x24, 0x6c, 0x30, 0x00, 0x24, 0x6c, 0x30, 0x2e, 0x5f, 0x5f, + 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x5f, 0x00, 0x5f, 0x5f, 0x69, 0x74, + 0x65, 0x6d, 0x00, 0x32, 0x00, 0x40, 0x72, 0x65, 0x73, 0x5f, 0x6c, + 0x69, 0x73, 0x74, 0x2e, 0x61, 0x70, 0x70, 0x65, 0x6e, 0x64, 0x00, + 0x2d, 0x31, 0x00, /* const pool */ }; - pikaVM_runByteCode(self, (uint8_t*)bytes); - return arg_copy(obj_getArg(self, "__res")); + return pikaVM_runByteCodeReturn(self, (uint8_t*)bytes, "@res_list"); } PikaObj* New_PikaStdData_List(Args * args); return arg_newDirectObj(New_PikaStdData_List); @@ -503,7 +505,7 @@ char* PikaStdLib_SysObj_cformat(PikaObj* self, char* fmt, PikaTuple* var) { int PikaStdLib_SysObj_id(PikaObj* self, Arg* obj) { uintptr_t ptr = 0; - if (argType_isObject(arg_getType(obj))) { + if (arg_isObject(obj)) { ptr = (uintptr_t)arg_getPtr(obj); } else { ptr = (uintptr_t)obj; @@ -529,8 +531,8 @@ PikaObj* PikaStdLib_SysObj_open(PikaObj* self, char* path, char* mode) { } /* __dir_each */ -int32_t __dir_each(Arg* argEach, Args* context) { - PikaObj* list = args_getPtr(context, "list"); +int32_t __dir_each(Arg* argEach, void* context) { + PikaObj* list = args_getPtr((Args*)context, "list"); if (argType_isCallable(arg_getType(argEach))) { char name_buff[PIKA_LINE_BUFF_SIZE] = {0}; char* method_name = @@ -543,7 +545,7 @@ int32_t __dir_each(Arg* argEach, Args* context) { } PikaObj* PikaStdLib_SysObj_dir(PikaObj* self, Arg* arg) { - if (!argType_isObject(arg_getType(arg))) { + if (!arg_isObject(arg)) { obj_setErrorCode(self, 1); __platform_printf("[Error] dir: not support type.\r\n"); return NULL; @@ -578,13 +580,12 @@ Arg* PikaStdLib_SysObj_getattr(PikaObj* self, PikaObj* obj, char* name) { Arg* arg = obj_getArg(obj, name); if (NULL == arg) { arg = obj_getMethodArg(obj, name); - return arg_copy(arg); } if (NULL != arg) { res = arg_copy(arg); - return res; + methodArg_setHostObj(res, obj); } - return NULL; + return res; } void PikaStdLib_SysObj_setattr(PikaObj* self, @@ -665,3 +666,11 @@ void PikaStdLib_SysObj_help(PikaObj* self, char* name) { void PikaStdLib_SysObj_reboot(PikaObj* self) { pika_platform_reboot(); } + +void PikaStdLib_SysObj_clear(PikaObj* self) { + pika_platform_clear(); +} + +void PikaStdLib_SysObj_gcdump(PikaObj* self) { + pikaGC_markDump(); +} diff --git a/examples/pikapython/pikapython/pikascript-lib/_thread/_thread.c b/examples/pikapython/pikapython/pikascript-lib/_thread/_thread.c index df1c0d32..f73c8e56 100755 --- a/examples/pikapython/pikapython/pikascript-lib/_thread/_thread.c +++ b/examples/pikapython/pikapython/pikascript-lib/_thread/_thread.c @@ -1,5 +1,6 @@ #include "_thread.h" #include "PikaVM.h" +#include "TinyObj.h" typedef struct pika_thread_info { Arg* function; @@ -9,12 +10,20 @@ typedef struct pika_thread_info { static void _thread_func(void* arg) { pika_debug("waiting for first lock"); - while (!_VM_is_first_lock()) { + while (1) { + if (_VM_is_first_lock()) { + break; + } + //! This May break the thread + // if (_VMEvent_getVMCnt() <= 0) { + // break; + // } + pika_debug("VM num %d", _VMEvent_getVMCnt()); pika_platform_thread_delay(); } pika_debug("thread start"); pika_GIL_ENTER(); - PikaObj* ctx = New_PikaObj(); + PikaObj* ctx = New_TinyObj(NULL); pika_thread_info* info = (pika_thread_info*)arg; obj_setArg(ctx, "args", info->args); obj_setArg(ctx, "thread", info->function); diff --git a/examples/pikapython/pikapython/pikascript-lib/pika_cjson/cJSON.c b/examples/pikapython/pikapython/pikascript-lib/pika_cjson/cJSON.c index 3b4ad9ea..d64667f3 100755 --- a/examples/pikapython/pikapython/pikascript-lib/pika_cjson/cJSON.c +++ b/examples/pikapython/pikapython/pikascript-lib/pika_cjson/cJSON.c @@ -44,6 +44,7 @@ #include #include #include +#include "PikaObj.h" #ifdef ENABLE_LOCALES #include @@ -124,7 +125,7 @@ CJSON_PUBLIC(double) cJSON_GetNumberValue(const cJSON * const item) CJSON_PUBLIC(const char*) cJSON_Version(void) { static char version[15]; - sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); + pika_platform_sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); return version; } @@ -560,18 +561,18 @@ static cJSON_bool print_number(const cJSON * const item, printbuffer * const out /* This checks for NaN and Infinity */ if (isnan(d) || isinf(d)) { - length = sprintf((char*)number_buffer, "null"); + length = pika_platform_sprintf((char*)number_buffer, "null"); } else { /* Try 15 decimal places of precision to avoid nonsignificant nonzero digits */ - length = sprintf((char*)number_buffer, "%1.15g", d); + length = pika_platform_sprintf((char*)number_buffer, "%1.15g", d); /* Check whether the original double can be recovered */ if ((sscanf((char*)number_buffer, "%lg", &test) != 1) || !compare_double((double)test, d)) { /* If not, print with 17 decimal places of precision */ - length = sprintf((char*)number_buffer, "%1.17g", d); + length = pika_platform_sprintf((char*)number_buffer, "%1.17g", d); } } @@ -1004,7 +1005,7 @@ static cJSON_bool print_string_ptr(const unsigned char * const input, printbuffe break; default: /* escape and print as unicode codepoint */ - sprintf((char*)output_pointer, "u%04x", *input_pointer); + pika_platform_sprintf((char*)output_pointer, "u%04x", *input_pointer); output_pointer += 4; break; } diff --git a/examples/pikapython/pikapython/pikascript-lib/pika_libc/README.md b/examples/pikapython/pikapython/pikascript-lib/pika_libc/README.md new file mode 100644 index 00000000..9e86dc7f --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-lib/pika_libc/README.md @@ -0,0 +1,3 @@ +# Usage + +Cancel all `__platform_xxprintf()` and `__platform_xxsprintf()`, then add `__platform_putchar()` . diff --git a/examples/pikapython/pikapython/pikascript-lib/pika_libc/pika_vsnprintf.c b/examples/pikapython/pikapython/pikascript-lib/pika_libc/pika_vsnprintf.c new file mode 100644 index 00000000..7de518a0 --- /dev/null +++ b/examples/pikapython/pikapython/pikascript-lib/pika_libc/pika_vsnprintf.c @@ -0,0 +1,1273 @@ +/* + * Copyright (c) 2021, Meco Jianting Man + * + * SPDX-License-Identifier: Apache-2.0 + * + * Change Logs: + * Date Author Notes + * 2021-11-27 Meco Man porting for rt_vsnprintf as the fully functional + * version + */ + +/** + * @author (c) Eyal Rozenberg + * 2021, Haifa, Palestine/Israel + * @author (c) Marco Paland (info@paland.com) + * 2014-2019, PALANDesign Hannover, Germany + * + * @note Others have made smaller contributions to this file: see the + * contributors page at https://github.com/eyalroz/printf/graphs/contributors + * or ask one of the authors. + * + * @brief Small stand-alone implementation of the printf family of functions + * (`(v)printf`, `(v)s(n)printf` etc., geared towards use on embedded systems + * with a very limited resources. + * + * @note the implementations are thread-safe; re-entrant; use no functions from + * the standard library; and do not dynamically allocate any memory. + * + * @license The MIT License (MIT) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include +#include +#include +#include "pika_adapter_rtt.h" + +// 'ntoa' conversion buffer size, this must be big enough to hold one converted +// numeric number including padded zeros (dynamically created on stack) +#ifndef PRINTF_INTEGER_BUFFER_SIZE +#define PRINTF_INTEGER_BUFFER_SIZE 32 +#endif + +// 'ftoa' conversion buffer size, this must be big enough to hold one converted +// float number including padded zeros (dynamically created on stack) +#ifndef PRINTF_FTOA_BUFFER_SIZE +#define PRINTF_FTOA_BUFFER_SIZE 32 +#endif + +// Support for the decimal notation floating point conversion specifiers (%f, +// %F) +#ifndef PRINTF_SUPPORT_DECIMAL_SPECIFIERS +#define PRINTF_SUPPORT_DECIMAL_SPECIFIERS 1 +#endif + +// Support for the exponential notatin floating point conversion specifiers (%e, +// %g, %E, %G) +#ifndef PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS +#define PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS 1 +#endif + +// Default precision for the floating point conversion specifiers (the C +// standard sets this at 6) +#ifndef PRINTF_DEFAULT_FLOAT_PRECISION +#define PRINTF_DEFAULT_FLOAT_PRECISION 6 +#endif + +// According to the C languages standard, printf() and related functions must be +// able to print any integral number in floating-point notation, regardless of +// length, when using the %f specifier - possibly hundreds of characters, +// potentially overflowing your buffers. In this implementation, all values +// beyond this threshold are switched to exponential notation. +#ifndef PRINTF_MAX_INTEGRAL_DIGITS_FOR_DECIMAL +#define PRINTF_MAX_INTEGRAL_DIGITS_FOR_DECIMAL 9 +#endif + +// Support for the long long integral types (with the ll, z and t length +// modifiers for specifiers %d,%i,%o,%x,%X,%u, and with the %p specifier). Note: +// 'L' (long double) is not supported. +#ifndef PRINTF_SUPPORT_LONG_LONG +#define PRINTF_SUPPORT_LONG_LONG 1 +#endif + +#if PRINTF_SUPPORT_LONG_LONG +typedef unsigned long long printf_unsigned_value_t; +typedef long long printf_signed_value_t; +#else +typedef unsigned long printf_unsigned_value_t; +typedef long printf_signed_value_t; +#endif + +#define PRINTF_PREFER_DECIMAL false +#define PRINTF_PREFER_EXPONENTIAL true + +/////////////////////////////////////////////////////////////////////////////// + +// The following will convert the number-of-digits into an exponential-notation +// literal +#define PRINTF_CONCATENATE(s1, s2) s1##s2 +#define PRINTF_EXPAND_THEN_CONCATENATE(s1, s2) PRINTF_CONCATENATE(s1, s2) +#define PRINTF_FLOAT_NOTATION_THRESHOLD \ + PRINTF_EXPAND_THEN_CONCATENATE(1e, PRINTF_MAX_INTEGRAL_DIGITS_FOR_DECIMAL) + +// internal flag definitions +#define FLAGS_ZEROPAD (1U << 0U) +#define FLAGS_LEFT (1U << 1U) +#define FLAGS_PLUS (1U << 2U) +#define FLAGS_SPACE (1U << 3U) +#define FLAGS_HASH (1U << 4U) +#define FLAGS_UPPERCASE (1U << 5U) +#define FLAGS_CHAR (1U << 6U) +#define FLAGS_SHORT (1U << 7U) +#define FLAGS_LONG (1U << 8U) +#define FLAGS_LONG_LONG (1U << 9U) +#define FLAGS_PRECISION (1U << 10U) +#define FLAGS_ADAPT_EXP (1U << 11U) +#define FLAGS_POINTER (1U << 12U) +// Note: Similar, but not identical, effect as FLAGS_HASH + +#define BASE_BINARY 2 +#define BASE_OCTAL 8 +#define BASE_DECIMAL 10 +#define BASE_HEX 16 + +typedef uint8_t numeric_base_t; + +#if (PRINTF_SUPPORT_DECIMAL_SPECIFIERS || PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS) +#include +#if FLT_RADIX != 2 +#error "Non-binary-radix floating-point types are unsupported." +#endif + +#if DBL_MANT_DIG == 24 + +#define DOUBLE_SIZE_IN_BITS 32 +typedef uint32_t double_uint_t; +#define DOUBLE_EXPONENT_MASK 0xFFU +#define DOUBLE_BASE_EXPONENT 127 + +#elif DBL_MANT_DIG == 53 + +#define DOUBLE_SIZE_IN_BITS 64 +typedef uint64_t double_uint_t; +#define DOUBLE_EXPONENT_MASK 0x7FFU +#define DOUBLE_BASE_EXPONENT 1023 + +#else +#error "Unsupported double type configuration" +#endif +#define DOUBLE_STORED_MANTISSA_BITS (DBL_MANT_DIG - 1) + +typedef union { + double_uint_t U; + double F; +} double_with_bit_access; + +// This is unnecessary in C99, since compound initializers can be used, +// but: 1. Some compilers are finicky about this; 2. Some people may want to +// convert this to C89; +// 3. If you try to use it as C++, only C++20 supports compound literals +static inline double_with_bit_access get_bit_access(double x) { + double_with_bit_access dwba; + dwba.F = x; + return dwba; +} + +static inline int get_sign(double x) { + // The sign is stored in the highest bit + return get_bit_access(x).U >> (DOUBLE_SIZE_IN_BITS - 1); +} + +static inline int get_exp2(double_with_bit_access x) { + // The exponent in an IEEE-754 floating-point number occupies a contiguous + // sequence of bits (e.g. 52..62 for 64-bit doubles), but with a non-trivial + // representation: An unsigned offset from some negative value (with the + // extremal offset values reserved for special use). + return (int)((x.U >> DOUBLE_STORED_MANTISSA_BITS) & DOUBLE_EXPONENT_MASK) - + DOUBLE_BASE_EXPONENT; +} +#define PRINTF_ABS(_x) ((_x) > 0 ? (_x) : -(_x)) + +#endif // (PRINTF_SUPPORT_DECIMAL_SPECIFIERS || + // PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS) + +// Note in particular the behavior here on LONG_MIN or LLONG_MIN; it is valid +// and well-defined, but if you're not careful you can easily trigger undefined +// behavior with -LONG_MIN or -LLONG_MIN +#define ABS_FOR_PRINTING(_x) \ + ((printf_unsigned_value_t)((_x) > 0 ? (_x) : -((printf_signed_value_t)_x))) + +// output function type +typedef void (*out_fct_type)(char character, + void* buffer, + size_t idx, + size_t maxlen); + +// wrapper (used as buffer) for output function type +typedef struct { + void (*fct)(char character, void* arg); + void* arg; +} out_function_wrapper_type; + +// internal buffer output +static inline void out_buffer(char character, + void* buffer, + size_t idx, + size_t maxlen) { + if (idx < maxlen) { + ((char*)buffer)[idx] = character; + } +} + +// internal null output +static inline void out_discard(char character, + void* buffer, + size_t idx, + size_t maxlen) { + (void)character; + (void)buffer; + (void)idx; + (void)maxlen; +} + +// internal secure strlen +// @return The length of the string (excluding the terminating 0) limited by +// 'maxsize' +static inline unsigned int strnlen_s_(const char* str, size_t maxsize) { + const char* s; + for (s = str; *s && maxsize--; ++s) + ; + return (unsigned int)(s - str); +} + +// internal test if char is a digit (0-9) +// @return true if char is a digit +static inline bool is_digit_(char ch) { + return (ch >= '0') && (ch <= '9'); +} + +// internal ASCII string to unsigned int conversion +static unsigned int atoi_(const char** str) { + unsigned int i = 0U; + while (is_digit_(**str)) { + i = i * 10U + (unsigned int)(*((*str)++) - '0'); + } + return i; +} + +// output the specified string in reverse, taking care of any zero-padding +static size_t out_rev_(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + const char* buf, + size_t len, + unsigned int width, + unsigned int flags) { + const size_t start_idx = idx; + + // pad spaces up to given width + if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) { + for (size_t i = len; i < width; i++) { + out(' ', buffer, idx++, maxlen); + } + } + + // reverse string + while (len) { + out(buf[--len], buffer, idx++, maxlen); + } + + // append pad spaces up to given width + if (flags & FLAGS_LEFT) { + while (idx - start_idx < width) { + out(' ', buffer, idx++, maxlen); + } + } + + return idx; +} + +// Invoked by print_integer after the actual number has been printed, performing +// necessary work on the number's prefix (as the number is initially printed in +// reverse order) +static size_t print_integer_finalization(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + char* buf, + size_t len, + bool negative, + numeric_base_t base, + unsigned int precision, + unsigned int width, + unsigned int flags) { + size_t unpadded_len = len; + + // pad with leading zeros + { + if (!(flags & FLAGS_LEFT)) { + if (width && (flags & FLAGS_ZEROPAD) && + (negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) { + width--; + } + while ((flags & FLAGS_ZEROPAD) && (len < width) && + (len < PRINTF_INTEGER_BUFFER_SIZE)) { + buf[len++] = '0'; + } + } + + while ((len < precision) && (len < PRINTF_INTEGER_BUFFER_SIZE)) { + buf[len++] = '0'; + } + + if (base == BASE_OCTAL && (len > unpadded_len)) { + // Since we've written some zeros, we've satisfied the alternative + // format leading space requirement + flags &= ~FLAGS_HASH; + } + } + + // handle hash + if (flags & (FLAGS_HASH | FLAGS_POINTER)) { + if (!(flags & FLAGS_PRECISION) && len && + ((len == precision) || (len == width))) { + // Let's take back some padding digits to fit in what will + // eventually be the format-specific prefix + if (unpadded_len < len) { + len--; + } + if (len && (base == BASE_HEX)) { + if (unpadded_len < len) { + len--; + } + } + } + if ((base == BASE_HEX) && !(flags & FLAGS_UPPERCASE) && + (len < PRINTF_INTEGER_BUFFER_SIZE)) { + buf[len++] = 'x'; + } else if ((base == BASE_HEX) && (flags & FLAGS_UPPERCASE) && + (len < PRINTF_INTEGER_BUFFER_SIZE)) { + buf[len++] = 'X'; + } else if ((base == BASE_BINARY) && + (len < PRINTF_INTEGER_BUFFER_SIZE)) { + buf[len++] = 'b'; + } + if (len < PRINTF_INTEGER_BUFFER_SIZE) { + buf[len++] = '0'; + } + } + + if (len < PRINTF_INTEGER_BUFFER_SIZE) { + if (negative) { + buf[len++] = '-'; + } else if (flags & FLAGS_PLUS) { + buf[len++] = '+'; // ignore the space if the '+' exists + } else if (flags & FLAGS_SPACE) { + buf[len++] = ' '; + } + } + + return out_rev_(out, buffer, idx, maxlen, buf, len, width, flags); +} + +// An internal itoa-like function +static size_t print_integer(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + printf_unsigned_value_t value, + bool negative, + numeric_base_t base, + unsigned int precision, + unsigned int width, + unsigned int flags) { + char buf[PRINTF_INTEGER_BUFFER_SIZE]; + size_t len = 0U; + + if (!value) { + if (!(flags & FLAGS_PRECISION)) { + buf[len++] = '0'; + flags &= ~FLAGS_HASH; + // We drop this flag this since either the alternative and regular + // modes of the specifier don't differ on 0 values, or (in the case + // of octal) we've already provided the special handling for this + // mode. + } else if (base == BASE_HEX) { + flags &= ~FLAGS_HASH; + // We drop this flag this since either the alternative and regular + // modes of the specifier don't differ on 0 values + } + } else { + do { + const char digit = (char)(value % base); + buf[len++] = + (char)(digit < 10 ? '0' + digit + : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + + digit - 10); + value /= base; + } while (value && (len < PRINTF_INTEGER_BUFFER_SIZE)); + } + + return print_integer_finalization(out, buffer, idx, maxlen, buf, len, + negative, base, precision, width, flags); +} + +#if (PRINTF_SUPPORT_DECIMAL_SPECIFIERS || PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS) + +struct double_components { + int_fast64_t integral; + int_fast64_t fractional; + bool is_negative; +}; + +#define NUM_DECIMAL_DIGITS_IN_INT64_T 18 +#define PRINTF_MAX_PRECOMPUTED_POWER_OF_10 NUM_DECIMAL_DIGITS_IN_INT64_T +static const double powers_of_10[NUM_DECIMAL_DIGITS_IN_INT64_T] = { + 1e00, 1e01, 1e02, 1e03, 1e04, 1e05, 1e06, 1e07, 1e08, + 1e09, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17}; + +#define PRINTF_MAX_SUPPORTED_PRECISION NUM_DECIMAL_DIGITS_IN_INT64_T - 1 + +// Break up a double number - which is known to be a finite non-negative number +// - into its base-10 parts: integral - before the decimal point, and fractional +// - after it. Taken the precision into account, but does not change it even +// internally. +static struct double_components get_components(double number, + unsigned int precision) { + struct double_components number_; + number_.is_negative = get_sign(number); + double abs_number = (number_.is_negative) ? -number : number; + number_.integral = (int_fast64_t)abs_number; + double remainder = + (abs_number - number_.integral) * powers_of_10[precision]; + number_.fractional = (int_fast64_t)remainder; + + remainder -= (double)number_.fractional; + + if (remainder > 0.5) { + ++number_.fractional; + // handle rollover, e.g. case 0.99 with precision 1 is 1.0 + if ((double)number_.fractional >= powers_of_10[precision]) { + number_.fractional = 0; + ++number_.integral; + } + } else if (remainder == 0.5) { + if ((number_.fractional == 0U) || (number_.fractional & 1U)) { + // if halfway, round up if odd OR if last digit is 0 + ++number_.fractional; + } + } + + if (precision == 0U) { + remainder = abs_number - (double)number_.integral; + if ((!(remainder < 0.5) || (remainder > 0.5)) && + (number_.integral & 1)) { + // exactly 0.5 and ODD, then round up + // 1.5 -> 2, but 2.5 -> 2 + ++number_.integral; + } + } + return number_; +} + +struct scaling_factor { + double raw_factor; + bool multiply; // if true, need to multiply by raw_factor; otherwise need + // to divide by it +}; + +static double apply_scaling(double num, struct scaling_factor normalization) { + return normalization.multiply ? num * normalization.raw_factor + : num / normalization.raw_factor; +} + +static double unapply_scaling(double normalized, + struct scaling_factor normalization) { + return normalization.multiply ? normalized / normalization.raw_factor + : normalized * normalization.raw_factor; +} + +static struct scaling_factor update_normalization( + struct scaling_factor sf, + double extra_multiplicative_factor) { + struct scaling_factor result; + if (sf.multiply) { + result.multiply = true; + result.raw_factor = sf.raw_factor * extra_multiplicative_factor; + } else { + int factor_exp2 = get_exp2(get_bit_access(sf.raw_factor)); + int extra_factor_exp2 = + get_exp2(get_bit_access(extra_multiplicative_factor)); + + // Divide the larger-exponent raw raw_factor by the smaller + if (PRINTF_ABS(factor_exp2) > PRINTF_ABS(extra_factor_exp2)) { + result.multiply = false; + result.raw_factor = sf.raw_factor / extra_multiplicative_factor; + } else { + result.multiply = true; + result.raw_factor = extra_multiplicative_factor / sf.raw_factor; + } + } + return result; +} + +#if PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS +static struct double_components get_normalized_components( + bool negative, + unsigned int precision, + double non_normalized, + struct scaling_factor normalization) { + struct double_components components; + components.is_negative = negative; + components.integral = + (int_fast64_t)apply_scaling(non_normalized, normalization); + double remainder = + non_normalized - + unapply_scaling((double)components.integral, normalization); + double prec_power_of_10 = powers_of_10[precision]; + struct scaling_factor account_for_precision = + update_normalization(normalization, prec_power_of_10); + double scaled_remainder = apply_scaling(remainder, account_for_precision); + double rounding_threshold = 0.5; + + if (precision == 0U) { + components.fractional = 0; + components.integral += (scaled_remainder >= rounding_threshold); + if (scaled_remainder == rounding_threshold) { + // banker's rounding: Round towards the even number (making the mean + // error 0) + components.integral &= ~((int_fast64_t)0x1); + } + } else { + components.fractional = (int_fast64_t)scaled_remainder; + scaled_remainder -= components.fractional; + + components.fractional += (scaled_remainder >= rounding_threshold); + if (scaled_remainder == rounding_threshold) { + // banker's rounding: Round towards the even number (making the mean + // error 0) + components.fractional &= ~((int_fast64_t)0x1); + } + // handle rollover, e.g. the case of 0.99 with precision 1 becoming + // (0,100), and must then be corrected into (1, 0). + if ((double)components.fractional >= prec_power_of_10) { + components.fractional = 0; + ++components.integral; + } + } + return components; +} +#endif + +static size_t print_broken_up_decimal(struct double_components number_, + out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + unsigned int precision, + unsigned int width, + unsigned int flags, + char* buf, + size_t len) { + if (precision != 0U) { + // do fractional part, as an unsigned number + + unsigned int count = precision; + + if (flags & FLAGS_ADAPT_EXP && !(flags & FLAGS_HASH)) { + // %g/%G mandates we skip the trailing 0 digits... + if (number_.fractional > 0) { + while (true) { + int_fast64_t digit = number_.fractional % 10U; + if (digit != 0) { + break; + } + --count; + number_.fractional /= 10U; + } + } + // ... and even the decimal point if there are no + // non-zero fractional part digits (see below) + } + + if (number_.fractional > 0 || !(flags & FLAGS_ADAPT_EXP) || + (flags & FLAGS_HASH)) { + while (len < PRINTF_FTOA_BUFFER_SIZE) { + --count; + buf[len++] = (char)('0' + number_.fractional % 10U); + if (!(number_.fractional /= 10U)) { + break; + } + } + // add extra 0s + while ((len < PRINTF_FTOA_BUFFER_SIZE) && (count-- > 0U)) { + buf[len++] = '0'; + } + if (len < PRINTF_FTOA_BUFFER_SIZE) { + buf[len++] = '.'; + } + } + } else { + if (flags & FLAGS_HASH) { + if (len < PRINTF_FTOA_BUFFER_SIZE) { + buf[len++] = '.'; + } + } + } + + // Write the integer part of the number (it comes after the fractional + // since the character order is reversed) + while (len < PRINTF_FTOA_BUFFER_SIZE) { + buf[len++] = (char)('0' + (number_.integral % 10)); + if (!(number_.integral /= 10)) { + break; + } + } + + // pad leading zeros + if (!(flags & FLAGS_LEFT) && (flags & FLAGS_ZEROPAD)) { + if (width && + (number_.is_negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) { + width--; + } + while ((len < width) && (len < PRINTF_FTOA_BUFFER_SIZE)) { + buf[len++] = '0'; + } + } + + if (len < PRINTF_FTOA_BUFFER_SIZE) { + if (number_.is_negative) { + buf[len++] = '-'; + } else if (flags & FLAGS_PLUS) { + buf[len++] = '+'; // ignore the space if the '+' exists + } else if (flags & FLAGS_SPACE) { + buf[len++] = ' '; + } + } + + return out_rev_(out, buffer, idx, maxlen, buf, len, width, flags); +} + +// internal ftoa for fixed decimal floating point +static size_t print_decimal_number(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + double number, + unsigned int precision, + unsigned int width, + unsigned int flags, + char* buf, + size_t len) { + struct double_components value_ = get_components(number, precision); + return print_broken_up_decimal(value_, out, buffer, idx, maxlen, precision, + width, flags, buf, len); +} + +#if PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS +// internal ftoa variant for exponential floating-point type, contributed by +// Martijn Jasperse +static size_t print_exponential_number(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + double number, + unsigned int precision, + unsigned int width, + unsigned int flags, + char* buf, + size_t len) { + const bool negative = get_sign(number); + // This number will decrease gradually (by factors of 10) as we "extract" + // the exponent out of it + double abs_number = negative ? -number : number; + + int exp10; + bool abs_exp10_covered_by_powers_table; + struct scaling_factor normalization; + + // Determine the decimal exponent + if (abs_number == 0.0) { + // TODO: This is a special-case for 0.0 (and -0.0); but proper handling + // is required for denormals more generally. + exp10 = 0; // ... and no need to set a normalization factor or check + // the powers table + } else { + double_with_bit_access conv = get_bit_access(abs_number); + { + // based on the algorithm by David Gay + // (https://www.ampl.com/netlib/fp/dtoa.c) + int exp2 = get_exp2(conv); + // drop the exponent, so conv.F comes into the range [1,2) + conv.U = + (conv.U & + (((double_uint_t)(1) << DOUBLE_STORED_MANTISSA_BITS) - 1U)) | + ((double_uint_t)DOUBLE_BASE_EXPONENT + << DOUBLE_STORED_MANTISSA_BITS); + // now approximate log10 from the log2 integer part and an expansion + // of ln around 1.5 + exp10 = (int)(0.1760912590558 + exp2 * 0.301029995663981 + + (conv.F - 1.5) * 0.289529654602168); + // now we want to compute 10^exp10 but we want to be sure it won't + // overflow + exp2 = (int)(exp10 * 3.321928094887362 + 0.5); + const double z = + exp10 * 2.302585092994046 - exp2 * 0.6931471805599453; + const double z2 = z * z; + conv.U = ((double_uint_t)(exp2) + DOUBLE_BASE_EXPONENT) + << DOUBLE_STORED_MANTISSA_BITS; + // compute exp(z) using continued fractions, see + // https://en.wikipedia.org/wiki/Exponential_function#Continued_fractions_for_ex + conv.F *= 1 + 2 * z / (2 - z + (z2 / (6 + (z2 / (10 + z2 / 14))))); + // correct for rounding errors + if (abs_number < conv.F) { + exp10--; + conv.F /= 10; + } + } + abs_exp10_covered_by_powers_table = + PRINTF_ABS(exp10) < PRINTF_MAX_PRECOMPUTED_POWER_OF_10; + normalization.raw_factor = abs_exp10_covered_by_powers_table + ? powers_of_10[PRINTF_ABS(exp10)] + : conv.F; + } + + // We now begin accounting for the widths of the two parts of our printed + // field: the decimal part after decimal exponent extraction, and the + // base-10 exponent part. For both of these, the value of 0 has a special + // meaning, but not the same one: a 0 exponent-part width means "don't print + // the exponent"; a 0 decimal-part width means "use as many characters as + // necessary". + + bool fall_back_to_decimal_only_mode = false; + if (flags & FLAGS_ADAPT_EXP) { + int required_significant_digits = (precision == 0) ? 1 : (int)precision; + // Should we want to fall-back to "%f" mode, and only print the decimal + // part? + fall_back_to_decimal_only_mode = + (exp10 >= -4 && exp10 < required_significant_digits); + // Now, let's adjust the precision + // This also decided how we adjust the precision value - as in "%g" + // mode, "precision" is the number of _significant digits_, and this is + // when we "translate" the precision value to an actual number of + // decimal digits. + int precision_ = + (fall_back_to_decimal_only_mode) + ? (int)precision - 1 - exp10 + : (int)precision - + 1; // the presence of the exponent ensures only one + // significant digit comes before the decimal point + precision = (precision_ > 0 ? (unsigned)precision_ : 0U); + flags |= FLAGS_PRECISION; // make sure print_broken_up_decimal respects + // our choice above + } + + normalization.multiply = (exp10 < 0 && abs_exp10_covered_by_powers_table); + bool should_skip_normalization = + (fall_back_to_decimal_only_mode || exp10 == 0); + struct double_components decimal_part_components = + should_skip_normalization + ? get_components(negative ? -abs_number : abs_number, precision) + : get_normalized_components(negative, precision, abs_number, + normalization); + + // Account for roll-over, e.g. rounding from 9.99 to 100.0 - which effects + // the exponent and may require additional tweaking of the parts + if (fall_back_to_decimal_only_mode) { + if ((flags & FLAGS_ADAPT_EXP) && exp10 >= -1 && + decimal_part_components.integral == powers_of_10[exp10 + 1]) { + exp10++; // Not strictly necessary, since exp10 is no longer really + // used + precision--; + // ... and it should already be the case that + // decimal_part_components.fractional == 0 + } + // TODO: What about rollover strictly within the fractional part? + } else { + if (decimal_part_components.integral >= 10) { + exp10++; + decimal_part_components.integral = 1; + decimal_part_components.fractional = 0; + } + } + + // the exp10 format is "E%+03d" and largest possible exp10 value for a + // 64-bit double is "307" (for 2^1023), so we set aside 4-5 characters + // overall + unsigned int exp10_part_width = fall_back_to_decimal_only_mode ? 0U + : (PRINTF_ABS(exp10) < 100) ? 4U + : 5U; + + unsigned int decimal_part_width = + ((flags & FLAGS_LEFT) && exp10_part_width) + ? + // We're padding on the right, so the width constraint is the + // exponent part's problem, not the decimal part's, so we'll use as + // many characters as we need: + 0U + : + // We're padding on the left; so the width constraint is the decimal + // part's problem. Well, can both the decimal part and the exponent + // part fit within our overall width? + ((width > exp10_part_width) + ? + // Yes, so we limit our decimal part's width. + // (Note this is trivially valid even if we've fallen back to + // "%f" mode) + width - exp10_part_width + : + // No; we just give up on any restriction on the decimal part + // and use as many characters as we need + 0U); + + const size_t start_idx = idx; + idx = print_broken_up_decimal(decimal_part_components, out, buffer, idx, + maxlen, precision, decimal_part_width, flags, + buf, len); + + if (!fall_back_to_decimal_only_mode) { + out((flags & FLAGS_UPPERCASE) ? 'E' : 'e', buffer, idx++, maxlen); + idx = print_integer(out, buffer, idx, maxlen, ABS_FOR_PRINTING(exp10), + exp10 < 0, 10, 0, exp10_part_width - 1, + FLAGS_ZEROPAD | FLAGS_PLUS); + if (flags & FLAGS_LEFT) { + // We need to right-pad with spaces to meet the width requirement + while (idx - start_idx < width) + out(' ', buffer, idx++, maxlen); + } + } + return idx; +} +#endif // PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS + +static size_t print_floating_point(out_fct_type out, + char* buffer, + size_t idx, + size_t maxlen, + double value, + unsigned int precision, + unsigned int width, + unsigned int flags, + bool prefer_exponential) { + char buf[PRINTF_FTOA_BUFFER_SIZE]; + size_t len = 0U; + + // test for special values + if (value != value) + return out_rev_(out, buffer, idx, maxlen, "nan", 3, width, flags); + if (value < -DBL_MAX) + return out_rev_(out, buffer, idx, maxlen, "fni-", 4, width, flags); + if (value > DBL_MAX) + return out_rev_(out, buffer, idx, maxlen, + (flags & FLAGS_PLUS) ? "fni+" : "fni", + (flags & FLAGS_PLUS) ? 4U : 3U, width, flags); + + if (!prefer_exponential && ((value > PRINTF_FLOAT_NOTATION_THRESHOLD) || + (value < -PRINTF_FLOAT_NOTATION_THRESHOLD))) { + // The required behavior of standard printf is to print _every_ + // integral-part digit -- which could mean printing hundreds of + // characters, overflowing any fixed internal buffer and necessitating a + // more complicated implementation. +#if PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS + return print_exponential_number(out, buffer, idx, maxlen, value, + precision, width, flags, buf, len); +#else + return 0U; +#endif + } + + // set default precision, if not set explicitly + if (!(flags & FLAGS_PRECISION)) { + precision = PRINTF_DEFAULT_FLOAT_PRECISION; + } + + // limit precision so that our integer holding the fractional part does not + // overflow + while ((len < PRINTF_FTOA_BUFFER_SIZE) && + (precision > PRINTF_MAX_SUPPORTED_PRECISION)) { + buf[len++] = + '0'; // This respects the precision in terms of result length only + precision--; + } + + return +#if PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS + prefer_exponential + ? print_exponential_number(out, buffer, idx, maxlen, value, + precision, width, flags, buf, len) + : +#endif + print_decimal_number(out, buffer, idx, maxlen, value, precision, + width, flags, buf, len); +} + +#endif // (PRINTF_SUPPORT_DECIMAL_SPECIFIERS || + // PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS) + +// internal vsnprintf +static int __vsnprintf(out_fct_type out, + char* buffer, + const size_t maxlen, + const char* format, + va_list va) { + unsigned int flags, width, precision, n; + size_t idx = 0U; + + if (!buffer) { + // use null output function + out = out_discard; + } + + while (*format) { + // format specifier? %[flags][width][.precision][length] + if (*format != '%') { + // no + out(*format, buffer, idx++, maxlen); + format++; + continue; + } else { + // yes, evaluate it + format++; + } + + // evaluate flags + flags = 0U; + do { + switch (*format) { + case '0': + flags |= FLAGS_ZEROPAD; + format++; + n = 1U; + break; + case '-': + flags |= FLAGS_LEFT; + format++; + n = 1U; + break; + case '+': + flags |= FLAGS_PLUS; + format++; + n = 1U; + break; + case ' ': + flags |= FLAGS_SPACE; + format++; + n = 1U; + break; + case '#': + flags |= FLAGS_HASH; + format++; + n = 1U; + break; + default: + n = 0U; + break; + } + } while (n); + + // evaluate width field + width = 0U; + if (is_digit_(*format)) { + width = atoi_(&format); + } else if (*format == '*') { + const int w = va_arg(va, int); + if (w < 0) { + flags |= FLAGS_LEFT; // reverse padding + width = (unsigned int)-w; + } else { + width = (unsigned int)w; + } + format++; + } + + // evaluate precision field + precision = 0U; + if (*format == '.') { + flags |= FLAGS_PRECISION; + format++; + if (is_digit_(*format)) { + precision = atoi_(&format); + } else if (*format == '*') { + const int precision_ = (int)va_arg(va, int); + precision = precision_ > 0 ? (unsigned int)precision_ : 0U; + format++; + } + } + + // evaluate length field + switch (*format) { + case 'l': + flags |= FLAGS_LONG; + format++; + if (*format == 'l') { + flags |= FLAGS_LONG_LONG; + format++; + } + break; + case 'h': + flags |= FLAGS_SHORT; + format++; + if (*format == 'h') { + flags |= FLAGS_CHAR; + format++; + } + break; + case 't': + flags |= (sizeof(ptrdiff_t) == sizeof(long) ? FLAGS_LONG + : FLAGS_LONG_LONG); + format++; + break; + case 'j': + flags |= (sizeof(intmax_t) == sizeof(long) ? FLAGS_LONG + : FLAGS_LONG_LONG); + format++; + break; + case 'z': + flags |= (sizeof(size_t) == sizeof(long) ? FLAGS_LONG + : FLAGS_LONG_LONG); + format++; + break; + default: + break; + } + + // evaluate specifier + switch (*format) { + case 'd': + case 'i': + case 'u': + case 'x': + case 'X': + case 'o': + case 'b': { + // set the base + numeric_base_t base; + if (*format == 'x' || *format == 'X') { + base = BASE_HEX; + } else if (*format == 'o') { + base = BASE_OCTAL; + } else if (*format == 'b') { + base = BASE_BINARY; + } else { + base = BASE_DECIMAL; + flags &= ~FLAGS_HASH; // no hash for dec format + } + // uppercase + if (*format == 'X') { + flags |= FLAGS_UPPERCASE; + } + + // no plus or space flag for u, x, X, o, b + if ((*format != 'i') && (*format != 'd')) { + flags &= ~(FLAGS_PLUS | FLAGS_SPACE); + } + + // ignore '0' flag when precision is given + if (flags & FLAGS_PRECISION) { + flags &= ~FLAGS_ZEROPAD; + } + + // convert the integer + if ((*format == 'i') || (*format == 'd')) { + // signed + if (flags & FLAGS_LONG_LONG) { +#if PRINTF_SUPPORT_LONG_LONG + const long long value = va_arg(va, long long); + idx = print_integer(out, buffer, idx, maxlen, + ABS_FOR_PRINTING(value), value < 0, + base, precision, width, flags); +#endif + } else if (flags & FLAGS_LONG) { + const long value = va_arg(va, long); + idx = print_integer(out, buffer, idx, maxlen, + ABS_FOR_PRINTING(value), value < 0, + base, precision, width, flags); + } else { + const int value = + (flags & FLAGS_CHAR) ? (signed char)va_arg(va, int) + : (flags & FLAGS_SHORT) ? (short int)va_arg(va, int) + : va_arg(va, int); + idx = print_integer(out, buffer, idx, maxlen, + ABS_FOR_PRINTING(value), value < 0, + base, precision, width, flags); + } + } else { + // unsigned + if (flags & FLAGS_LONG_LONG) { +#if PRINTF_SUPPORT_LONG_LONG + idx = + print_integer(out, buffer, idx, maxlen, + (printf_unsigned_value_t)va_arg( + va, unsigned long long), + false, base, precision, width, flags); +#endif + } else if (flags & FLAGS_LONG) { + idx = print_integer( + out, buffer, idx, maxlen, + (printf_unsigned_value_t)va_arg(va, unsigned long), + false, base, precision, width, flags); + } else { + const unsigned int value = + (flags & FLAGS_CHAR) + ? (unsigned char)va_arg(va, unsigned int) + : (flags & FLAGS_SHORT) + ? (unsigned short int)va_arg(va, unsigned int) + : va_arg(va, unsigned int); + idx = + print_integer(out, buffer, idx, maxlen, + (printf_unsigned_value_t)value, false, + base, precision, width, flags); + } + } + format++; + break; + } +#if PRINTF_SUPPORT_DECIMAL_SPECIFIERS + case 'f': + case 'F': + if (*format == 'F') + flags |= FLAGS_UPPERCASE; + idx = print_floating_point(out, buffer, idx, maxlen, + va_arg(va, double), precision, width, + flags, PRINTF_PREFER_DECIMAL); + format++; + break; +#endif +#if PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS + case 'e': + case 'E': + case 'g': + case 'G': + if ((*format == 'g') || (*format == 'G')) + flags |= FLAGS_ADAPT_EXP; + if ((*format == 'E') || (*format == 'G')) + flags |= FLAGS_UPPERCASE; + idx = print_floating_point(out, buffer, idx, maxlen, + va_arg(va, double), precision, width, + flags, PRINTF_PREFER_EXPONENTIAL); + format++; + break; +#endif // PRINTF_SUPPORT_EXPONENTIAL_SPECIFIERS + case 'c': { + unsigned int l = 1U; + // pre padding + if (!(flags & FLAGS_LEFT)) { + while (l++ < width) { + out(' ', buffer, idx++, maxlen); + } + } + // char output + out((char)va_arg(va, int), buffer, idx++, maxlen); + // post padding + if (flags & FLAGS_LEFT) { + while (l++ < width) { + out(' ', buffer, idx++, maxlen); + } + } + format++; + break; + } + + case 's': { + const char* p = va_arg(va, char*); + if (p == NULL) { + idx = out_rev_(out, buffer, idx, maxlen, ")llun(", 6, width, + flags); + } else { + unsigned int l = + strnlen_s_(p, precision ? precision : (size_t)-1); + // pre padding + if (flags & FLAGS_PRECISION) { + l = (l < precision ? l : precision); + } + if (!(flags & FLAGS_LEFT)) { + while (l++ < width) { + out(' ', buffer, idx++, maxlen); + } + } + // string output + while ((*p != 0) && + (!(flags & FLAGS_PRECISION) || precision--)) { + out(*(p++), buffer, idx++, maxlen); + } + // post padding + if (flags & FLAGS_LEFT) { + while (l++ < width) { + out(' ', buffer, idx++, maxlen); + } + } + } + format++; + break; + } + + case 'p': { + width = sizeof(void*) * 2U + + 2; // 2 hex chars per byte + the "0x" prefix + flags |= FLAGS_ZEROPAD | FLAGS_POINTER; + uintptr_t value = (uintptr_t)va_arg(va, void*); + idx = (value == (uintptr_t)NULL) + ? out_rev_(out, buffer, idx, maxlen, ")lin(", 5, + width, flags) + : print_integer(out, buffer, idx, maxlen, + (printf_unsigned_value_t)value, false, + BASE_HEX, precision, width, flags); + format++; + break; + } + + case '%': + out('%', buffer, idx++, maxlen); + format++; + break; + + default: + out(*format, buffer, idx++, maxlen); + format++; + break; + } + } + + // termination + out((char)0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen); + + // return written chars without terminating \0 + return (int)idx; +} + +/** + * This function will fill a formatted string to buffer. + * + * @param buf is the buffer to save formatted string. + * + * @param size is the size of buffer. + * + * @param fmt is the format parameters. + * + * @param args is a list of variable parameters. + * + * @return The number of characters actually written to buffer. + */ +static int pika_vsnprintf(char* buf, + rt_size_t size, + const char* fmt, + va_list args) { + return __vsnprintf(out_buffer, buf, size, fmt, args); +} + +int __platform_vsnprintf(char* buff, + size_t size, + const char* fmt, + va_list args) { + return pika_vsnprintf(buff, size, fmt, args); +} diff --git a/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl.c b/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl.c index 3e2617f0..b50b97e3 100755 --- a/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl.c +++ b/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl.c @@ -1,4 +1,4 @@ -#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) #include "lvgl.h" #else #include "../../lvgl.h" @@ -201,11 +201,19 @@ PikaObj* pika_lvgl_scr_act(PikaObj* self) { return new_obj; } +volatile g_lvgl_inited = 0; void pika_lvgl___init__(PikaObj* self) { obj_newDirectObj(self, "lv_event_listener", New_TinyObj); pika_lv_event_listener_g = obj_getObj(self, "lv_event_listener"); pika_lv_id_register_g = New_args(NULL); - lv_png_init(); + if (!g_lvgl_inited) { + lv_png_init(); + g_lvgl_inited = 1; + } +} + +void pika_lvgl___del__(PikaObj* self) { + args_deinit(pika_lv_id_register_g); } void pika_lvgl_obj___init__(PikaObj* self, PikaTuple* parent) { diff --git a/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl_lv_obj.c b/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl_lv_obj.c index 5be0460a..e0bc25f0 100755 --- a/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl_lv_obj.c +++ b/examples/pikapython/pikapython/pikascript-lib/pika_lvgl/pika_lvgl_lv_obj.c @@ -1,4 +1,4 @@ -#if defined(LV_LVGL_H_INCLUDE_SIMPLE) +#if defined(LV_LVGL_H_INCLUDE_SIMPLE) #include "lvgl.h" #else #include "../../lvgl.h" @@ -56,7 +56,7 @@ void pika_lvgl_lv_obj_add_state(PikaObj* self, int state) { lv_obj_add_state(lv_obj, state); } -PikaObj* eventLisener_getHandler(PikaObj* self, uintptr_t event_id) { +PikaObj* eventListener_getHandler(PikaObj* self, uintptr_t event_id) { Args buffs = {0}; char* event_name = strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id); @@ -69,13 +69,13 @@ PikaObj* eventLisener_getHandler(PikaObj* self, uintptr_t event_id) { static void __pika_event_cb(lv_event_t* e) { lv_obj_t* target = lv_event_get_target(e); PikaObj* event_handler = - eventLisener_getHandler(pika_lv_event_listener_g, (uintptr_t)target); + eventListener_getHandler(pika_lv_event_listener_g, (uintptr_t)target); PikaObj* evt = obj_getObj(event_handler, "_event_evt"); obj_setPtr(evt, "lv_event", e); obj_run(event_handler, "_event_cb(_event_evt)"); } -void eventLicener_registEvent(PikaObj* self, +void eventListener_registEvent(PikaObj* self, uintptr_t event_id, PikaObj* event_handler) { Args buffs = {0}; @@ -83,7 +83,7 @@ void eventLicener_registEvent(PikaObj* self, strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", event_id); obj_newDirectObj(self, event_name, New_TinyObj); PikaObj* event_item = obj_getObj(self, event_name); - obj_setRef(event_item, "handler", event_handler); + obj_setPtr(event_item, "handler", event_handler); strsDeinit(&buffs); } @@ -96,7 +96,7 @@ void pika_lvgl_lv_obj_add_event_cb(PikaObj* self, obj_setArg(self, "_event_cb", event_cb); obj_setPtr(self, "_event_user_data", user_data); obj_newDirectObj(self, "_event_evt", New_pika_lvgl_lv_event); - eventLicener_registEvent(pika_lv_event_listener_g, (uintptr_t)lv_obj, self); + eventListener_registEvent(pika_lv_event_listener_g, (uintptr_t)lv_obj, self); } void pika_lvgl_lv_obj_add_style(PikaObj* self, PikaObj* style, int selector) { @@ -333,4 +333,14 @@ void pika_lvgl_lv_obj_clean(PikaObj *self){ lv_obj_clean(lv_obj); } +void pika_lvgl_lv_obj_del_(PikaObj* self) { + lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj"); + Args buffs = {0}; + char* event_name = + strsFormat(&buffs, PIKA_SPRINTF_BUFF_SIZE, "%d", (uintptr_t)lv_obj); + obj_removeArg(pika_lv_event_listener_g, event_name); + strsDeinit(&buffs); + lv_obj_del(lv_obj); +} + #endif diff --git a/examples/pikapython/pikapython/requestment.txt b/examples/pikapython/pikapython/requestment.txt index 0e28e69b..d088feff 100644 --- a/examples/pikapython/pikapython/requestment.txt +++ b/examples/pikapython/pikapython/requestment.txt @@ -1,15 +1,16 @@ pikascript-core==latest PikaStdLib==latest -PikaStdDevice==v2.3.5 +PikaStdDevice==v2.3.6 configparser==v0.2.1 -pika_cjson==v1.2.1 +pika_cjson==v1.2.2 json==v0.1.1 PikaMath==v0.2.1 unittest==v0.1.2 re==v0.1.1 binascii==v0.0.1 -modbus==v0.0.3 +modbus==v0.0.4 time==v0.1.3 -pika_lvgl==v0.4.3 -_thread==v0.0.2 -random==v0.1.1 \ No newline at end of file +pika_lvgl==v0.4.4 +_thread==v0.0.3 +random==v0.1.1 +pika_libc==v1.0.1 \ No newline at end of file diff --git a/examples/pikapython/pikapython/rust-msc-latest-win10.exe b/examples/pikapython/pikapython/rust-msc-latest-win10.exe index 612ef8c3..8b10ff5f 100755 Binary files a/examples/pikapython/pikapython/rust-msc-latest-win10.exe and b/examples/pikapython/pikapython/rust-msc-latest-win10.exe differ diff --git a/examples/pikapython/proj.conf b/examples/pikapython/proj.conf index 0c90cb3b..c7730c72 100644 --- a/examples/pikapython/proj.conf +++ b/examples/pikapython/proj.conf @@ -8,4 +8,12 @@ set(CONFIG_FREERTOS 1) set(CONFIG_FATFS 1) set(CONFIG_LVGL 1) set(CONFIG_BSP_LCD 1) -set(CONFIG_BSP_TOUCH 1) \ No newline at end of file +set(CONFIG_BSP_TOUCH 1) + +set(CONFIG_CHERRYUSB 1) +set(CONFIG_CHERRYUSB_DEVICE 1) +set(CONFIG_CHERRYUSB_DEVICE_CDC 1) +set(CONFIG_CHERRYUSB_DEVICE_HID 1) +set(CONFIG_CHERRYUSB_DEVICE_MSC 1) +set(CONFIG_CHERRYUSB_DEVICE_AUDIO 1) +set(CONFIG_CHERRYUSB_DEVICE_VIDEO 1) \ No newline at end of file diff --git a/examples/pikapython/usb_config.h b/examples/pikapython/usb_config.h new file mode 100644 index 00000000..8989c5a3 --- /dev/null +++ b/examples/pikapython/usb_config.h @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2022, sakumisu + * + * SPDX-License-Identifier: Apache-2.0 + */ +#ifndef CHERRYUSB_CONFIG_H +#define CHERRYUSB_CONFIG_H + +/* ================ USB common Configuration ================ */ + +#define CONFIG_USB_PRINTF(...) printf(__VA_ARGS__) + +#define usb_malloc(size) malloc(size) +#define usb_free(ptr) free(ptr) + +#ifndef CONFIG_USB_DBG_LEVEL +#define CONFIG_USB_DBG_LEVEL USB_DBG_INFO +#endif + +/* Enable print with color */ +#define CONFIG_USB_PRINTF_COLOR_ENABLE + +/* data align size when use dma */ +#ifndef CONFIG_USB_ALIGN_SIZE +#define CONFIG_USB_ALIGN_SIZE 4 +#endif + +/* attribute data into no cache ram */ +#define USB_NOCACHE_RAM_SECTION __attribute__((section(".noncacheable"))) + +/* ================= USB Device Stack Configuration ================ */ + +/* Ep0 max transfer buffer, specially for receiving data from ep0 out */ +#define CONFIG_USBDEV_REQUEST_BUFFER_LEN 256 + +/* Setup packet log for debug */ +// #define CONFIG_USBDEV_SETUP_LOG_PRINT + +/* Check if the input descriptor is correct */ +// #define CONFIG_USBDEV_DESC_CHECK + +/* Enable test mode */ +// #define CONFIG_USBDEV_TEST_MODE + +#ifndef CONFIG_USBDEV_MSC_BLOCK_SIZE +#define CONFIG_USBDEV_MSC_BLOCK_SIZE 512 +#endif + +#ifndef CONFIG_USBDEV_MSC_MANUFACTURER_STRING +#define CONFIG_USBDEV_MSC_MANUFACTURER_STRING "" +#endif + +#ifndef CONFIG_USBDEV_MSC_PRODUCT_STRING +#define CONFIG_USBDEV_MSC_PRODUCT_STRING "" +#endif + +#ifndef CONFIG_USBDEV_MSC_VERSION_STRING +#define CONFIG_USBDEV_MSC_VERSION_STRING "0.01" +#endif + +// #define CONFIG_USBDEV_MSC_THREAD + +#ifdef CONFIG_USBDEV_MSC_THREAD +#ifndef CONFIG_USBDEV_MSC_STACKSIZE +#define CONFIG_USBDEV_MSC_STACKSIZE 2048 +#endif + +#ifndef CONFIG_USBDEV_MSC_PRIO +#define CONFIG_USBDEV_MSC_PRIO 4 +#endif +#endif + +#ifndef CONFIG_USBDEV_AUDIO_VERSION +#define CONFIG_USBDEV_AUDIO_VERSION 0x0100 +#endif + +#ifndef CONFIG_USBDEV_AUDIO_MAX_CHANNEL +#define CONFIG_USBDEV_AUDIO_MAX_CHANNEL 8 +#endif + +/* ================ USB HOST Stack Configuration ================== */ + +#define CONFIG_USBHOST_MAX_RHPORTS 1 +#define CONFIG_USBHOST_MAX_EXTHUBS 1 +#define CONFIG_USBHOST_MAX_EHPORTS 4 +#define CONFIG_USBHOST_MAX_INTERFACES 6 +#define CONFIG_USBHOST_MAX_INTF_ALTSETTINGS 8 +#define CONFIG_USBHOST_MAX_ENDPOINTS 4 + +#define CONFIG_USBHOST_DEV_NAMELEN 16 + +#ifndef CONFIG_USBHOST_PSC_PRIO +#define CONFIG_USBHOST_PSC_PRIO 4 +#endif +#ifndef CONFIG_USBHOST_PSC_STACKSIZE +#define CONFIG_USBHOST_PSC_STACKSIZE 2048 +#endif + +//#define CONFIG_USBHOST_GET_STRING_DESC + +/* Ep0 max transfer buffer */ +#define CONFIG_USBHOST_REQUEST_BUFFER_LEN 512 + +#ifndef CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT +#define CONFIG_USBHOST_CONTROL_TRANSFER_TIMEOUT 500 +#endif + +#ifndef CONFIG_USBHOST_MSC_TIMEOUT +#define CONFIG_USBHOST_MSC_TIMEOUT 5000 +#endif + +/* ================ USB Device Port Configuration ================*/ + +//#define USBD_IRQHandler USBD_IRQHandler +//#define USB_BASE (0x40080000UL) +//#define USB_NUM_BIDIR_ENDPOINTS 4 + +/* ================ USB Host Port Configuration ==================*/ + +#define CONFIG_USBHOST_PIPE_NUM 10 + +/* ================ EHCI Configuration ================ */ + +#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000) +#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10) +#define CONFIG_USB_EHCI_FRAME_LIST_SIZE 1024 +// #define CONFIG_USB_EHCI_INFO_ENABLE +#define CONFIG_USB_ECHI_HCOR_RESERVED_DISABLE +// #define CONFIG_USB_EHCI_CONFIGFLAG +// #define CONFIG_USB_EHCI_PORT_POWER + +#endif \ No newline at end of file diff --git a/examples/pikapython/usbd_cdc_user.c b/examples/pikapython/usbd_cdc_user.c new file mode 100644 index 00000000..8cce95de --- /dev/null +++ b/examples/pikapython/usbd_cdc_user.c @@ -0,0 +1,212 @@ +#include "usbd_core.h" +#include "usbd_cdc.h" + +/*!< endpoint address */ +#define CDC_IN_EP 0x81 +#define CDC_OUT_EP 0x02 +#define CDC_INT_EP 0x83 + +#define USBD_VID 0xFFFF +#define USBD_PID 0xFFFF +#define USBD_MAX_POWER 100 +#define USBD_LANGID_STRING 1033 + +/*!< config descriptor size */ +#define USB_CONFIG_SIZE (9 + CDC_ACM_DESCRIPTOR_LEN) + +/*!< global descriptor */ +static const uint8_t cdc_descriptor[] = { + USB_DEVICE_DESCRIPTOR_INIT(USB_2_0, 0xEF, 0x02, 0x01, USBD_VID, USBD_PID, 0x0100, 0x01), + USB_CONFIG_DESCRIPTOR_INIT(USB_CONFIG_SIZE, 0x02, 0x01, USB_CONFIG_BUS_POWERED, USBD_MAX_POWER), + CDC_ACM_DESCRIPTOR_INIT(0x00, CDC_INT_EP, CDC_OUT_EP, CDC_IN_EP, 0x02), + /////////////////////////////////////// + /// string0 descriptor + /////////////////////////////////////// + USB_LANGID_INIT(USBD_LANGID_STRING), + /////////////////////////////////////// + /// string1 descriptor + /////////////////////////////////////// + 0x14, /* bLength */ + USB_DESCRIPTOR_TYPE_STRING, /* bDescriptorType */ + 'C', 0x00, /* wcChar0 */ + 'h', 0x00, /* wcChar1 */ + 'e', 0x00, /* wcChar2 */ + 'r', 0x00, /* wcChar3 */ + 'r', 0x00, /* wcChar4 */ + 'y', 0x00, /* wcChar5 */ + 'U', 0x00, /* wcChar6 */ + 'S', 0x00, /* wcChar7 */ + 'B', 0x00, /* wcChar8 */ + /////////////////////////////////////// + /// string2 descriptor + /////////////////////////////////////// + 0x26, /* bLength */ + USB_DESCRIPTOR_TYPE_STRING, /* bDescriptorType */ + 'C', 0x00, /* wcChar0 */ + 'h', 0x00, /* wcChar1 */ + 'e', 0x00, /* wcChar2 */ + 'r', 0x00, /* wcChar3 */ + 'r', 0x00, /* wcChar4 */ + 'y', 0x00, /* wcChar5 */ + 'U', 0x00, /* wcChar6 */ + 'S', 0x00, /* wcChar7 */ + 'B', 0x00, /* wcChar8 */ + ' ', 0x00, /* wcChar9 */ + 'C', 0x00, /* wcChar10 */ + 'D', 0x00, /* wcChar11 */ + 'C', 0x00, /* wcChar12 */ + ' ', 0x00, /* wcChar13 */ + 'D', 0x00, /* wcChar14 */ + 'E', 0x00, /* wcChar15 */ + 'M', 0x00, /* wcChar16 */ + 'O', 0x00, /* wcChar17 */ + /////////////////////////////////////// + /// string3 descriptor + /////////////////////////////////////// + 0x16, /* bLength */ + USB_DESCRIPTOR_TYPE_STRING, /* bDescriptorType */ + '2', 0x00, /* wcChar0 */ + '0', 0x00, /* wcChar1 */ + '2', 0x00, /* wcChar2 */ + '2', 0x00, /* wcChar3 */ + '1', 0x00, /* wcChar4 */ + '2', 0x00, /* wcChar5 */ + '3', 0x00, /* wcChar6 */ + '4', 0x00, /* wcChar7 */ + '5', 0x00, /* wcChar8 */ + '6', 0x00, /* wcChar9 */ +#ifdef CONFIG_USB_HS + /////////////////////////////////////// + /// device qualifier descriptor + /////////////////////////////////////// + 0x0a, + USB_DESCRIPTOR_TYPE_DEVICE_QUALIFIER, + 0x00, + 0x02, + 0x02, + 0x02, + 0x01, + 0x40, + 0x01, + 0x00, +#endif + 0x00 +}; + +USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t read_buffer[2048]; +USB_NOCACHE_RAM_SECTION USB_MEM_ALIGNX uint8_t write_buffer[2048]; + +volatile bool ep_tx_busy_flag = false; +volatile bool ep_rx_ready_flag = false; + +#ifdef CONFIG_USB_HS +#define CDC_MAX_MPS 512 +#else +#define CDC_MAX_MPS 64 +#endif + +void usbd_configure_done_callback(void) +{ + /* setup first out ep read transfer */ + usbd_ep_start_read(CDC_OUT_EP, read_buffer, 2048); +} + +void usbd_cdc_acm_bulk_out(uint8_t ep, uint32_t nbytes) +{ + ep_rx_ready_flag = true; +} + +void usbd_cdc_acm_bulk_in(uint8_t ep, uint32_t nbytes) +{ + // USB_LOG_RAW("actual in len:%d\r\n", nbytes); + + if ((nbytes % CDC_MAX_MPS) == 0 && nbytes) { + /* send zlp */ + usbd_ep_start_write(CDC_IN_EP, NULL, 0); + } else { + ep_tx_busy_flag = false; + } +} + +/*!< endpoint call back */ +struct usbd_endpoint cdc_out_ep = { + .ep_addr = CDC_OUT_EP, + .ep_cb = usbd_cdc_acm_bulk_out +}; + +struct usbd_endpoint cdc_in_ep = { + .ep_addr = CDC_IN_EP, + .ep_cb = usbd_cdc_acm_bulk_in +}; + +struct usbd_interface intf0; +struct usbd_interface intf1; + +/* function ------------------------------------------------------------------*/ +void cdc_acm_init(void) +{ + const uint8_t data[10] = { 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x30 }; + + memcpy(&write_buffer[0], data, 10); + memset(&write_buffer[10], 'a', 2038); + + usbd_desc_register(cdc_descriptor); + usbd_add_interface(usbd_cdc_acm_init_intf(&intf0)); + usbd_add_interface(usbd_cdc_acm_init_intf(&intf1)); + usbd_add_endpoint(&cdc_out_ep); + usbd_add_endpoint(&cdc_in_ep); + usbd_initialize(); +} + +volatile uint8_t dtr_enable = 0; + +void usbd_cdc_acm_set_dtr(uint8_t intf, bool dtr) +{ + if (dtr) { + dtr_enable = 1; + } else { + dtr_enable = 0; + } +} + +int usbd_ep_write_sync(uint8_t ep, const void *buf, uint32_t nbytes) +{ + ep_tx_busy_flag = true; + usbd_ep_start_write(ep, buf, nbytes); + while (ep_tx_busy_flag) { + } + return 0; +} + +int usbd_ep_read_sync(uint8_t ep, void *buf, uint32_t nbytes) +{ + memset(buf, 0, nbytes); + ep_rx_ready_flag = false; + usbd_ep_start_read(ep, buf, nbytes); + while (!ep_rx_ready_flag) { + } + return 0; +} + +int usb_cdc_user_putchar(char ch) +{ + // printf("usb_cdc_user_putchar:%c\r\n", ch); + write_buffer[0] = ch; + usbd_ep_write_sync(CDC_IN_EP, write_buffer, 1); + return 0; +} + +char usb_cdc_user_getchar(void) +{ + usbd_ep_read_sync(CDC_OUT_EP, &read_buffer, 1); + // printf("usb_cdc_user_getchar:%c\r\n", read_buffer[0]); + return read_buffer[0]; +} + +void cdc_acm_data_send_with_dtr_test(void) +{ + // if (dtr_enable) { + usbd_ep_read_sync(CDC_OUT_EP, read_buffer, 2048); + usbd_ep_write_sync(CDC_IN_EP, read_buffer, strlen(read_buffer)); + // } +} \ No newline at end of file diff --git a/examples/pikapython/usbd_cdc_user.h b/examples/pikapython/usbd_cdc_user.h new file mode 100644 index 00000000..352279a5 --- /dev/null +++ b/examples/pikapython/usbd_cdc_user.h @@ -0,0 +1,14 @@ +#ifndef _USBD_CDC_H_ +#define _USBD_CDC_H_ + +#include "usbd_core.h" +#include "usbd_cdc.h" + +void cdc_acm_init(void); +int usbd_ep_read_sync(void *buf, uint32_t nbytes); +int usbd_ep_write_sync(const void *buf, uint32_t nbytes); +void cdc_acm_data_send_with_dtr_test(void); +char usb_cdc_user_getchar(void); +int usb_cdc_user_putchar(char ch); + +#endif \ No newline at end of file