diff options
| author | robojumper <robojumper@gmail.com> | 2025-04-24 14:56:08 +0200 |
|---|---|---|
| committer | robojumper <robojumper@gmail.com> | 2025-04-24 14:56:08 +0200 |
| commit | 892059c2997f7cf2da1c21244ba8db0edbbc00da (patch) | |
| tree | d38c4177423f44ec17109d64feb40f9db5423013 /include | |
| parent | 7fa483e8509e80725a4a6599eaf8c9e2308cfc19 (diff) | |
Most of LibMS OK
Diffstat (limited to 'include')
| -rw-r--r-- | include/d/lyt/d_textbox.h | 4 | ||||
| -rw-r--r-- | include/libms/commonlib.h | 2 | ||||
| -rw-r--r-- | include/libms/flowfile.h | 8 | ||||
| -rw-r--r-- | include/libms/libms.h | 8 | ||||
| -rw-r--r-- | include/libms/msgfile.h | 10 |
5 files changed, 22 insertions, 10 deletions
diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h index 57b406fc..88b9c703 100644 --- a/include/d/lyt/d_textbox.h +++ b/include/d/lyt/d_textbox.h @@ -58,7 +58,9 @@ public: void setTextWithTextProcessor(const wchar_t *str, dTagProcessor_c *tagProcessor, void *, ...); s32 calcTextLines(const wchar_t *src, dTagProcessor_c *tagProcessor); - void setMessageWithGlobalTextProcessorAndMsbtInfo(const MsbtInfo *info, const char *labelId, wchar_t *destBuf, u32 maxLen); + void setMessageWithGlobalTextProcessorAndMsbtInfo( + MsbtInfo *info, const char *labelId, wchar_t *destBuf, u32 maxLen + ); void loadTextFormatVars(); void setupGX() const; diff --git a/include/libms/commonlib.h b/include/libms/commonlib.h index 7a0680e4..6829f278 100644 --- a/include/libms/commonlib.h +++ b/include/libms/commonlib.h @@ -48,6 +48,8 @@ void LMSi_AnalyzeMessageBinary(struct MsbInfo *info, const char *type); int LMSi_SearchBlockByName(struct MsbInfo *info, const char *name); int LMSi_GetHashTableIndexFromLabel(const char *label, int tableSize); +#define LMS_OFS_TO_PTR(ty, ptr, offset) (ty *)((char *)(ptr) + (offset)) + #ifdef __cplusplus } #endif diff --git a/include/libms/flowfile.h b/include/libms/flowfile.h index edd1710f..dbd5be3d 100644 --- a/include/libms/flowfile.h +++ b/include/libms/flowfile.h @@ -10,23 +10,23 @@ extern "C" { struct MsbfInfo; struct MsbFlowInfo { - /* 0x00 */ char type; + /* 0x00 */ unsigned char type; /* 0x01 */ char subType; /* 0x04 */ int params1n2; /* 0x08 */ short next; /* 0x0A */ short param3; /* 0x0C */ short param4; - /* 0x0E */ short param5; + /* 0x0E */ unsigned short param5; }; // Func names are made up struct MsbfInfo *LMS_InitFlow(void *data); void LMS_CloseFlow(struct MsbfInfo *info); -int LMS_GetFlow(struct MsbfInfo *info, int index); +int LMS_GetFlow(struct MsbfInfo *info); int LMS_GetEntrypoint(struct MsbfInfo *info, const char *label); struct MsbFlowInfo *LMS_GetFlowElement(struct MsbfInfo *info, int index); -const unsigned short *LMS_GetBranchPoints(struct MsbfInfo *info, int index); +unsigned short *LMS_GetBranchPoints(struct MsbfInfo *info, int index); #ifdef __cplusplus } diff --git a/include/libms/libms.h b/include/libms/libms.h index 86345e16..6ad2fd22 100644 --- a/include/libms/libms.h +++ b/include/libms/libms.h @@ -7,6 +7,14 @@ extern "C" { #endif +// made up +enum LMS_Error { + LMS_NOT_FOUND = -1, + LMS_MISSING_LBL1_DATA = -2, + LMS_MISSING_FLW3_DATA = -4, + LMS_MISSING_FEN1_DATA = -10, +}; + void LMS_SetMemFuncs(void *(*alloc)(size_t size), void (*free)(void *ptr)); // internal diff --git a/include/libms/msgfile.h b/include/libms/msgfile.h index bc6f2aaa..b9433f05 100644 --- a/include/libms/msgfile.h +++ b/include/libms/msgfile.h @@ -17,11 +17,11 @@ struct MsbtAttrInfo { struct MsbtInfo *LMS_InitMessage(void *data); void LMS_CloseMessage(struct MsbtInfo *info); -int LMS_GetTextIndexByLabel(const struct MsbtInfo *info, const char *label); -const wchar_t *LMS_GetText(const struct MsbtInfo *info, int index); -const wchar_t *LMS_GetTextByLabel(const struct MsbtInfo *info, const char *label); -const char *LMS_GetLabelByTextIndex(const struct MsbtInfo *info, int index); -struct MsbtAttrInfo *LMS_GetAttribute(const struct MsbtInfo *info, int index); +int LMS_GetTextIndexByLabel(struct MsbtInfo *info, const char *label); +const wchar_t *LMS_GetText(struct MsbtInfo *info, int index); +const wchar_t *LMS_GetTextByLabel(struct MsbtInfo *info, const char *label); +int LMS_GetLabelByTextIndex(struct MsbtInfo *info, int index, char *outLabel); +struct MsbtAttrInfo *LMS_GetAttribute(struct MsbtInfo *info, int index); #ifdef __cplusplus } |
