Next: , Previous: Usage example, Up: MIN Text interface usage


11.3 MIN Text interface API description

Text *tx_create (const char * txt)
Creates Text structure and initializes it.
const char * txt
Initial value, C-string.
Return value
Test interface initialized with *txt value
void tx_destroy (Text ** txt)
Destroys Text structure allocated with tx_create
Text ** txt
Text interface to be destroyed
Return value
none
void tx_append (Text * dest, const Text * src)
Appends one Text interface to another
Text * dest
Text interface to append to
const Text * src
Text interface to be appended to *dest
Return value
none
void tx_copy (Text * dest, const Text * src)
Copies content of one Text to another
Text * dest
Destination Text interface
const Text * src
Source Text interface
Return value
none
void tx_c_append (Text * dest, const char *src)
Appends C string to Text interface
Text * dest
Destination Text interface to append to
const char *src
C-string to be appended to *dest
Return value
none
void tx_prepend (Text * src, Text * dest)
Prepends to one Text interface another
Text * src
Text interface to be prepended to *dest
Text * dest
Text interface to prepend to
Return value
none
void tx_c_prepend (Text * src, const char * dest)
Prepends C-string to Text interface
Text * src
Text interface to prepend to
const char * dest
C-string to be prepended to *src
Return value
none
tx_c_copy (Text * dest, const char *src)
Copies content of c string to Text interface
Text * dest
Text interface to copy the string to
const char *src
C-string to be copied to *dest
Return value
none
char *tx_get_buf (Text * txt)
Getter for C string representation of data held in Text interface
Text * txt
Text interface to copy from
Return value
Copy of data held by the Text interface
char *tx_share_buf (Text * txt)
Getter for adress of data held in Text interface
Text * txt
Text interface to get pointer from
Return value
pointer to the data held by Text interface
void tx_back_trim (Text * txt, const char *chars)
Removes specified set of characters from the end of Text
Text * txt
Text interface to remove from
const char *chars
Characters to be removed
Return value
none
char tx_at (Text * txt, unsigned int index)
Gives character from the Text that is at given position
Text * txt
Text interface
unsigned int index
index of character
Return value
Character at index position

If index exceeds the length of the data NULL byte is returned

tx_int_append (Text * dest, const char *options, int src)
Appends integer to Text interface
Text * dest
Text interface to append to
const char *options
format modifiers [flags][width][.precision][length].

Modifiers are the same as in printf (for more details see man printf)

int src
Number to append to Text interface
Return value
none