From f01e41be12fec307ff7955e9bebc2dd012d49273 Mon Sep 17 00:00:00 2001 From: kichikuou Date: Sun, 26 Apr 2026 17:45:04 +0900 Subject: [PATCH] Implement InputString.SetResultString Used in Rance 02. --- src/hll/InputString.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/hll/InputString.c b/src/hll/InputString.c index 9ff2d82..c9f3894 100644 --- a/src/hll/InputString.c +++ b/src/hll/InputString.c @@ -39,13 +39,20 @@ static void InputString_ClearResultString(void) result = string_ref(&EMPTY_STRING); } -struct string *InputString_GetResultString(void) +static struct string *InputString_GetResultString(void) { struct string *s = string_ref(result); InputString_ClearResultString(); return s; } +static void InputString_SetResultString(struct string *s) +{ + if (result) + free_string(result); + result = string_ref(s); +} + static void InputString_SetFont(int nSize, possibly_unused struct string *pIName, int nWeight) { font_size = nSize; @@ -119,5 +126,6 @@ HLL_LIBRARY(InputString, HLL_EXPORT(CloseIME, InputString_CloseIME), HLL_EXPORT(GetResultString, InputString_GetResultString), HLL_EXPORT(ClearResultString, InputString_ClearResultString), + HLL_EXPORT(SetResultString, InputString_SetResultString), HLL_EXPORT(Inputs, InputString_Inputs), HLL_EXPORT(Converts, InputString_Converts));