Fix only for returned string

This commit is contained in:
Stephan Hadinger 2022-10-18 10:04:04 +02:00
parent f87324f874
commit 1d34a80f65
2 changed files with 5 additions and 3 deletions

View File

@ -876,7 +876,7 @@ const be_ntv_func_def_t lv_dropdown_func[] = {
{ "get_options", { (const void*) &lv_dropdown_get_options, "s", "(lv.lv_obj)" } }, { "get_options", { (const void*) &lv_dropdown_get_options, "s", "(lv.lv_obj)" } },
{ "get_selected", { (const void*) &lv_dropdown_get_selected, "i", "(lv.lv_obj)" } }, { "get_selected", { (const void*) &lv_dropdown_get_selected, "i", "(lv.lv_obj)" } },
{ "get_selected_highlight", { (const void*) &lv_dropdown_get_selected_highlight, "b", "(lv.lv_obj)" } }, { "get_selected_highlight", { (const void*) &lv_dropdown_get_selected_highlight, "b", "(lv.lv_obj)" } },
{ "get_selected_str", { (const void*) &lv_dropdown_get_selected_str, "", "(lv.lv_obj)si" } }, { "get_selected_str", { (const void*) &lv_dropdown_get_selected_str, "", "(lv.lv_obj)ci" } },
{ "get_symbol", { (const void*) &lv_dropdown_get_symbol, "s", "(lv.lv_obj)" } }, { "get_symbol", { (const void*) &lv_dropdown_get_symbol, "s", "(lv.lv_obj)" } },
{ "get_text", { (const void*) &lv_dropdown_get_text, "s", "(lv.lv_obj)" } }, { "get_text", { (const void*) &lv_dropdown_get_text, "s", "(lv.lv_obj)" } },
{ "is_open", { (const void*) &lv_dropdown_is_open, "b", "(lv.lv_obj)" } }, { "is_open", { (const void*) &lv_dropdown_is_open, "b", "(lv.lv_obj)" } },
@ -929,7 +929,7 @@ const be_ntv_func_def_t lv_roller_func[] = {
{ "get_option_cnt", { (const void*) &lv_roller_get_option_cnt, "i", "(lv.lv_obj)" } }, { "get_option_cnt", { (const void*) &lv_roller_get_option_cnt, "i", "(lv.lv_obj)" } },
{ "get_options", { (const void*) &lv_roller_get_options, "s", "(lv.lv_obj)" } }, { "get_options", { (const void*) &lv_roller_get_options, "s", "(lv.lv_obj)" } },
{ "get_selected", { (const void*) &lv_roller_get_selected, "i", "(lv.lv_obj)" } }, { "get_selected", { (const void*) &lv_roller_get_selected, "i", "(lv.lv_obj)" } },
{ "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.lv_obj)si" } }, { "get_selected_str", { (const void*) &lv_roller_get_selected_str, "", "(lv.lv_obj)ci" } },
{ "set_options", { (const void*) &lv_roller_set_options, "", "(lv.lv_obj)s(lv.lv_roller_mode)" } }, { "set_options", { (const void*) &lv_roller_set_options, "", "(lv.lv_obj)s(lv.lv_roller_mode)" } },
{ "set_selected", { (const void*) &lv_roller_set_selected, "", "(lv.lv_obj)ii" } }, { "set_selected", { (const void*) &lv_roller_set_selected, "", "(lv.lv_obj)ii" } },
{ "set_visible_row_count", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.lv_obj)i" } }, { "set_visible_row_count", { (const void*) &lv_roller_set_visible_row_count, "", "(lv.lv_obj)i" } },

View File

@ -35,9 +35,10 @@ return_types = {
"int32_t": "i", "int32_t": "i",
"void *": ".", "void *": ".",
"const void *": ".", "const void *": ".",
"char *": "s", "char *": "c",
"uint8_t *": "c", "uint8_t *": "c",
"const char *": "s", "const char *": "s",
"retchar *": "s",
"constchar *": "s", # special construct "constchar *": "s", # special construct
"lv_obj_user_data_t": "i", "lv_obj_user_data_t": "i",
@ -245,6 +246,7 @@ with open(lv_widgets_file) as f:
l_raw = re.sub('static ', '', l_raw) l_raw = re.sub('static ', '', l_raw)
l_raw = re.sub('inline ', '', l_raw) l_raw = re.sub('inline ', '', l_raw)
l_raw = re.sub('const\s+char\s*\*', 'constchar *', l_raw) l_raw = re.sub('const\s+char\s*\*', 'constchar *', l_raw)
l_raw = re.sub('^char\s*\*', 'retchar *', l_raw) # special case for returning a char*
l_raw = re.sub('const ', '', l_raw) l_raw = re.sub('const ', '', l_raw)
l_raw = re.sub('struct ', '', l_raw) l_raw = re.sub('struct ', '', l_raw)
if (len(l_raw) == 0): continue if (len(l_raw) == 0): continue