summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorrobojumper <robojumper@gmail.com>2025-04-25 18:40:43 +0200
committerrobojumper <robojumper@gmail.com>2025-04-25 18:40:43 +0200
commitf8a982ed054f800d205b4bd0ef2e35d95f3dfc42 (patch)
treeb720049f6d6c981def4b6e5492606db7662754e3 /include
parent8f968f92925803f1c6d2f7f7f26cc93f38692bb3 (diff)
parente10e8a4f0247a7fbe4feecf93f107707f231bf0c (diff)
Merge remote-tracking branch 'upstream/main' into d_lyt_meter_stuff
Diffstat (limited to 'include')
-rw-r--r--include/d/lyt/d_textbox.h5
-rw-r--r--include/libms/commonlib.h2
-rw-r--r--include/libms/flowfile.h8
-rw-r--r--include/libms/libms.h8
-rw-r--r--include/libms/msgfile.h10
5 files changed, 21 insertions, 12 deletions
diff --git a/include/d/lyt/d_textbox.h b/include/d/lyt/d_textbox.h
index 75d44987..e92c39a8 100644
--- a/include/d/lyt/d_textbox.h
+++ b/include/d/lyt/d_textbox.h
@@ -62,9 +62,8 @@ 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
}