EZ Text Replacer for Zelda64Recompiled 2.2.0
 
Loading...
Searching...
No Matches
MsgSContent

Functions for manipulating message text content. More...

Functions

void EZTR_MsgSContent_SetEmpty (char *cont)
 Sets the message message content as empty.
 
u32 EZTR_MsgSContent_Len (char *cont)
 Gets the length of the a message content string in bytes, not counting the '\xBF' termination character.
 
u32 EZTR_MsgSContent_NCopy (char *dst, char *src, size_t len)
 Copies message content from src into the dst, up to len bytes.
 
u32 EZTR_MsgSContent_Copy (char *dst, char *src)
 Copies message content from src into the dst.
 
char * EZTR_MsgSContent_NCat (char *dst, char *src, size_t len)
 Copies the message content of src onto the end of dst, up to len bytes from src.
 
char * EZTR_MsgSContent_Cat (char *dst, char *src)
 Copies the message content of src onto the end of dst.
 
s32 EZTR_MsgSContent_NCmp (char *str1, char *str2, size_t len)
 Compares up to len bytes of two message content strings.
 
s32 EZTR_MsgSContent_Cmp (char *str1, char *str2)
 Compares two message content strings.
 
int EZTR_MsgSContent_Printf (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_PrintfLine (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Sprintf (char *buffer, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Snprintf (char *buffer, size_t count, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Vsnprintf (char *buffer, size_t count, const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Vprintf (const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.
 
int EZTR_MsgSContent_Fctprintf (void(*out)(char character, void *arg), void *arg, const char *format,...)
 A modified version of printf, specially designed to handle message content.
 
int EZTR_MsgSContent_NoPipe_Printf (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_PrintfLine (const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Sprintf (char *buffer, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Snprintf (char *buffer, size_t count, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Vsnprintf (char *buffer, size_t count, const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Vprintf (const char *format, va_list va)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 
int EZTR_MsgSContent_NoPipe_Fctprintf (void(*out)(char character, void *arg), void *arg, const char *format,...)
 A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.
 

Detailed Description

Functions for manipulating message text content.

Function Documentation

◆ EZTR_MsgSContent_Cat()

char * EZTR_MsgSContent_Cat ( char * dst,
char * src )

Copies the message content of src onto the end of dst.

Similar to strcat() for null-terminated strings.

This function is safe as long as dst points to the beginning of a message buffer's content region, as it will not produce message content larger than a message buffer's content region. Copying will stop once the maximum size is reached.

Parameters
dstThe location to append message content into.
srcThe message content to copy. Should be '\xBF' terminated.
Returns
char* The pointer to the new string (i.e: to dst).

◆ EZTR_MsgSContent_Cmp()

s32 EZTR_MsgSContent_Cmp ( char * str1,
char * str2 )

Compares two message content strings.

This function is safe as long as both str1 and str2 point to the content region of message buffers, as the comparison will not continue beyond that size.

Similar to strcmp() for null-terminated strings, but with one notable difference: With strncmp(), if two strings are equal for the first n characters, but one string continues after n while
the other doesn't, the shorter string is considered 'lesser' because the null terminator ‘’\x00'is naturally the lowest possible ASCII value. Because strings in MM are'\xBF'` terminated, that behavior won't apply here.

In EZTR_MsgSContent_Cmp(), a special case is applied: If two strings are equal for n characters, but the next character after n is ‘’\xBF'` in one of the strings, it is considered the lesser string regardless of what the other character is.

Parameters
str1The first message content string to compare.
str2The second message content string to compare.
Returns
s32 Returns 0 is the strings are the same, 1 if the first string is greater than the second, and -1 if the second string is greater than the first.

◆ EZTR_MsgSContent_Copy()

u32 EZTR_MsgSContent_Copy ( char * dst,
char * src )

Copies message content from src into the dst.

Similar to strcpy() for null-terminated strings.

This function is safe as long as dst points to the beginning of a message buffer's content region, since it will not copy bytes beyond that size.

Parameters
dstThe location to copy message content into.
srcThe message content to copy. Should be '\xBF' terminated.
Returns
u32 The number of bytes copied.

◆ EZTR_MsgSContent_Fctprintf()

int EZTR_MsgSContent_Fctprintf ( void(* out )(char character, void *arg),
void * arg,
const char * format,
... )

A modified version of printf, specially designed to handle message content.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
out
arg
format
...
Returns
int

◆ EZTR_MsgSContent_Len()

u32 EZTR_MsgSContent_Len ( char * cont)

Gets the length of the a message content string in bytes, not counting the '\xBF' termination character.

Similar to strlen() for null-terminated strings.

This function is safe as long as cont points to the beginning of a message buffer's content region, since it will not count bytes beyond that size.

Parameters
contThe message content you want to get the length of.
Returns
u32 The length of the message content, in bytes.

◆ EZTR_MsgSContent_NCat()

char * EZTR_MsgSContent_NCat ( char * dst,
char * src,
size_t len )

Copies the message content of src onto the end of dst, up to len bytes from src.

Similar to strncat() for null-terminated strings.

This function will not produce message content larger than a message buffer's content region. Copying will stop once the maximum size is reached.

Parameters
dstThe location to append message content into.
srcThe message content to copy.
lenThe maximum number of bytes to copy. If a '\xBF' is encountered in src, the function will stop copying before len is reached.
Returns
char* The pointer to the new string (i.e: to dst).

◆ EZTR_MsgSContent_NCmp()

s32 EZTR_MsgSContent_NCmp ( char * str1,
char * str2,
size_t len )

Compares up to len bytes of two message content strings.

Similar to strncmp() for null-terminated strings, but with one notable difference: With strncmp(), if two strings are equal for the first n characters, but one string continues after n while
the other doesn't, the shorter string is considered 'lesser' because the null terminator ‘’\x00'is naturally the lowest possible ASCII value. Because strings in MM are'\xBF'` terminated, that behavior won't apply here.

In EZTR_MsgSContent_NCmp(), a special case is applied: If two strings are equal for n characters, but the next character after n is ‘’\xBF'` in one of the strings, it is considered the lesser string regardless of what the other character is.

Parameters
str1The first message content string to compare.
str2The second message content string to compare.
lenThe maximum number of bytes to compare.
Returns
s32 Returns 0 is the strings are the same, 1 if the first string is greater than the second, and -1 if the second string is greater than the first.

◆ EZTR_MsgSContent_NCopy()

u32 EZTR_MsgSContent_NCopy ( char * dst,
char * src,
size_t len )

Copies message content from src into the dst, up to len bytes.

Similar to strncpy() for null-terminated strings.

Parameters
dstThe location to copy message content into.
srcThe message content to copy.
lenThe maximum number of bytes to copy. If a '\xBF' is encountered in src, the function will stop copying before len is reached.
Returns
u32 The number of bytes copied.

◆ EZTR_MsgSContent_NoPipe_Fctprintf()

int EZTR_MsgSContent_NoPipe_Fctprintf ( void(* out )(char character, void *arg),
void * arg,
const char * format,
... )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
out
arg
format
...
Returns
int

◆ EZTR_MsgSContent_NoPipe_Printf()

int EZTR_MsgSContent_NoPipe_Printf ( const char * format,
... )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
...
Returns
int

◆ EZTR_MsgSContent_NoPipe_PrintfLine()

int EZTR_MsgSContent_NoPipe_PrintfLine ( const char * format,
... )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
...
Returns
int

◆ EZTR_MsgSContent_NoPipe_Snprintf()

int EZTR_MsgSContent_NoPipe_Snprintf ( char * buffer,
size_t count,
const char * format,
... )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
count
format
...
Returns
int

◆ EZTR_MsgSContent_NoPipe_Sprintf()

int EZTR_MsgSContent_NoPipe_Sprintf ( char * buffer,
const char * format,
... )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

Unlike EZTR_MsgSContent_Printf(), this function will append a newline to the end of console output.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
format
...
Returns
int

◆ EZTR_MsgSContent_NoPipe_Vprintf()

int EZTR_MsgSContent_NoPipe_Vprintf ( const char * format,
va_list va )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
va
Returns
int

◆ EZTR_MsgSContent_NoPipe_Vsnprintf()

int EZTR_MsgSContent_NoPipe_Vsnprintf ( char * buffer,
size_t count,
const char * format,
va_list va )

A modified version of printf, specially designed to handle message content. This version does not use pipe-escaped byte handling in the main formatting argument, but are still used with the m type specifier.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
count
format
va
Returns
int

◆ EZTR_MsgSContent_Printf()

int EZTR_MsgSContent_Printf ( const char * format,
... )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
...
Returns
int

◆ EZTR_MsgSContent_PrintfLine()

int EZTR_MsgSContent_PrintfLine ( const char * format,
... )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
...
Returns
int

◆ EZTR_MsgSContent_SetEmpty()

void EZTR_MsgSContent_SetEmpty ( char * cont)

Sets the message message content as empty.

This is accomplished by setting the first character in the message content to the '\xBF' termination character. No other bytes are effected.

Parameters
contA pointer to message content string.

◆ EZTR_MsgSContent_Snprintf()

int EZTR_MsgSContent_Snprintf ( char * buffer,
size_t count,
const char * format,
... )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
count
format
...
Returns
int

◆ EZTR_MsgSContent_Sprintf()

int EZTR_MsgSContent_Sprintf ( char * buffer,
const char * format,
... )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

Unlike EZTR_MsgSContent_Printf(), this function will append a newline to the end of console output.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
format
...
Returns
int

◆ EZTR_MsgSContent_Vprintf()

int EZTR_MsgSContent_Vprintf ( const char * format,
va_list va )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
format
va
Returns
int

◆ EZTR_MsgSContent_Vsnprintf()

int EZTR_MsgSContent_Vsnprintf ( char * buffer,
size_t count,
const char * format,
va_list va )

A modified version of printf, specially designed to handle message content. This version uses pipe-escaped byte handling in the main formatting argument.

See EZTR Printf Functions for more information on EZTR's custom printf behavior.

Parameters
buffer
count
format
va
Returns
int