1 #ifndef _EASYSTRUCT_UTIL_H
2 #define _EASYSTRUCT_UTIL_H
5 Copyright © 2016, The AROS Development Team. All rights reserved.
9 #include "alib_intern.h"
10 #include <intuition/intuition.h>
11 #include <proto/exec.h>
13 static inline STRPTR
CreateFormatStringFromEasyStruct(struct EasyStruct
*easyStruct
)
16 LONG lentext
= 0, lengadget
= 0;
18 if (easyStruct
->es_TextFormat
) lentext
= STRLEN(easyStruct
->es_TextFormat
);
19 if (easyStruct
->es_GadgetFormat
) lengadget
= STRLEN(easyStruct
->es_GadgetFormat
);
21 format
= AllocVec(lentext
+ lengadget
+ 1, MEMF_PUBLIC
);
22 CopyMem(easyStruct
->es_TextFormat
, format
, lentext
);
23 CopyMem(easyStruct
->es_GadgetFormat
, format
+ lentext
, lengadget
);
24 format
[lentext
+ lengadget
] = '\0';
29 static inline void FreeFormatString(STRPTR format
)
35 #endif /* _EASYSTRUCT_UTIL_H */