Commit 026d29f4 authored by Bjorn Reese's avatar Bjorn Reese

Upgraded to trio baseline 1.6

parent 572577e0
Sat Jan 19 16:36:21 CET 2002 Bjorn Reese <breese@users.sourceforge.net>
* trio.h trio.c triodef.h triop.h trionan.h trionan.c Makefile.am:
Upgraded to trio baseline 1.6
* strio.h strio.c: Replaced by triostr.h and triostr.c
Fri Jan 18 17:22:50 CET 2002 Daniel Veillard <daniel@veillard.com>
* globals.c xmlIO.c xmlcatalog.c: removed the last occurences
......
......@@ -21,7 +21,7 @@ libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
xpointer.c xinclude.c nanohttp.c nanoftp.c DOCBparser.c \
catalog.c globals.c threads.c strio.c trio.c
catalog.c globals.c threads.c triostr.c trio.c
else
libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
......@@ -568,7 +568,7 @@ EXTRA_DIST = xml2-config.in xml2Conf.sh.in libxml.spec.in libxml.spec \
libxml.m4 \
example/Makefile.am example/gjobread.c example/gjobs.xml \
$(man_MANS) libxml-2.0.pc.in \
trionan.c trionan.h strio.c strio.h trio.c trio.h \
trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
triop.h triodef.h libxml.h \
testThreadsWin32.c
......
This diff is collapsed.
/*************************************************************************
*
* $Id$
*
* Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
#ifndef TRIO_STRIO_H
#define TRIO_STRIO_H
#if !(defined(DEBUG) || defined(NDEBUG))
# define NDEBUG
#endif
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#ifndef STRIO_MALLOC
# define STRIO_MALLOC(n) malloc(n)
#endif
#ifndef STRIO_FREE
# define STRIO_FREE(x) free(x)
#endif
/*
* StrAppend(target, source)
* StrAppendMax(target, maxsize, source)
*
* Append 'source' to 'target'
*
* target = StrAlloc(size)
*
* Allocate a new string
*
* StrContains(target, substring)
*
* Find out if the string 'substring' is
* contained in the string 'target'
*
* StrCopy(target, source)
* StrCopyMax(target, maxsize, source)
*
* Copy 'source' to 'target'
*
* target = StrDuplicate(source)
* target = StrDuplicateMax(source, maxsize)
*
* Allocate and copy 'source' to 'target'
*
* StrEqual(first, second)
* StrEqualMax(first, maxsize, second)
*
* Compare if 'first' is equal to 'second'.
* Case-independent.
*
* StrEqualCase(first, second)
* StrEqualCaseMax(first, maxsize, second)
*
* Compare if 'first' is equal to 'second'
* Case-dependent. Please note that the use of the
* word 'case' has the opposite meaning as that of
* strcasecmp().
*
* StrFormat(target, format, ...)
* StrFormatMax(target, maxsize, format, ...)
*
* Build 'target' according to 'format' and succesive
* arguments. This is equal to the sprintf() and
* snprintf() functions.
*
* StrFormatDate(target, format, ...)
*
* StrFree(target)
*
* De-allocates a string
*
* StrHash(string, type)
*
* Calculates the hash value of 'string' based on the
* 'type'.
*
* StrIndex(target, character)
* StrIndexLast(target, character)
*
* Find the first/last occurrence of 'character' in
* 'target'
*
* StrLength(target)
*
* Return the length of 'target'
*
* StrMatch(string, pattern)
* StrMatchCase(string, pattern)
*
* Find 'pattern' within 'string'. 'pattern' may contain
* wildcards such as * (asterics) and ? (question mark)
* which matches zero or more characters and exactly
* on character respectively
*
* StrScan(source, format, ...)
*
* Equal to sscanf()
*
* StrSubstring(target, substring)
*
* Find the first occurrence of the string 'substring'
* within the string 'target'
*
* StrTokenize(target, list)
*
* Split 'target' into the first token delimited by
* one of the characters in 'list'. If 'target' is
* NULL then next token will be returned.
*
* StrToUpper(target)
*
* Convert all lower case characters in 'target' into
* upper case characters.
*/
enum {
STRIO_HASH_NONE = 0,
STRIO_HASH_PLAIN,
STRIO_HASH_TWOSIGNED
};
#if !defined(DEBUG) || defined(__DECC)
#define StrAlloc(n) (char *)STRIO_MALLOC(n)
#define StrAppend(x,y) strcat((x), (y))
#define StrContains(x,y) (0 != strstr((x), (y)))
#define StrCopy(x,y) strcpy((x), (y))
#define StrIndex(x,y) strchr((x), (y))
#define StrIndexLast(x,y) strrchr((x), (y))
#define StrFree(x) STRIO_FREE(x)
#define StrLength(x) strlen((x))
#define StrSubstring(x,y) strstr((x), (y))
#define StrTokenize(x,y) strtok((x), (y))
#define StrToLong(x,y,n) strtol((x), (y), (n))
#define StrToUnsignedLong(x,y,n) strtoul((x), (y), (n))
#else /* DEBUG */
/*
* To be able to use these macros everywhere, including in
* if() sentences, the assertions are put first in a comma
* seperated list.
*
* Unfortunately the DECC compiler does not seem to like this
* so it will use the un-asserted functions above for the
* debugging case too.
*/
#define StrAlloc(n) \
(assert((n) > 0),\
(char *)STRIO_MALLOC(n))
#define StrAppend(x,y) \
(assert((x) != NULL),\
assert((y) != NULL),\
strcat((x), (y)))
#define StrContains(x,y) \
(assert((x) != NULL),\
assert((y) != NULL),\
(0 != strstr((x), (y))))
#define StrCopy(x,y) \
(assert((x) != NULL),\
assert((y) != NULL),\
strcpy((x), (y)))
#define StrIndex(x,c) \
(assert((x) != NULL),\
strchr((x), (c)))
#define StrIndexLast(x,c) \
(assert((x) != NULL),\
strrchr((x), (c)))
#define StrFree(x) \
(assert((x) != NULL),\
STRIO_FREE(x))
#define StrLength(x) \
(assert((x) != NULL),\
strlen((x)))
#define StrSubstring(x,y) \
(assert((x) != NULL),\
assert((y) != NULL),\
strstr((x), (y)))
#define StrTokenize(x,y) \
(assert((y) != NULL),\
strtok((x), (y)))
#define StrToLong(x,y,n) \
(assert((x) != NULL),\
assert((y) != NULL),\
assert((n) >= 2 && (n) <= 36),\
strtol((x), (y), (n)))
#define StrToUnsignedLong(x,y,n) \
(assert((x) != NULL),\
assert((y) != NULL),\
assert((n) >= 2 && (n) <= 36),\
strtoul((x), (y), (n)))
#endif /* DEBUG */
char *StrAppendMax(char *target, size_t max, const char *source);
char *StrCopyMax(char *target, size_t max, const char *source);
char *StrDuplicate(const char *source);
char *StrDuplicateMax(const char *source, size_t max);
int StrEqual(const char *first, const char *second);
int StrEqualCase(const char *first, const char *second);
int StrEqualCaseMax(const char *first, size_t max, const char *second);
int StrEqualLocale(const char *first, const char *second);
int StrEqualMax(const char *first, size_t max, const char *second);
const char *StrError(int);
size_t StrFormatDateMax(char *target, size_t max, const char *format, const struct tm *datetime);
unsigned long StrHash(const char *string, int type);
int StrMatch(char *string, char *pattern);
int StrMatchCase(char *string, char *pattern);
size_t StrSpanFunction(char *source, int (*Function)(int));
char *StrSubstringMax(const char *string, size_t max, const char *find);
float StrToFloat(const char *source, const char **target);
double StrToDouble(const char *source, const char **target);
int StrToUpper(char *target);
#endif /* TRIO_STRIO_H */
This diff is collapsed.
......@@ -13,6 +13,10 @@
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
*************************************************************************
*
* http://ctrio.sourceforge.net/
*
************************************************************************/
#ifndef TRIO_TRIO_H
......@@ -41,6 +45,11 @@ extern "C" {
# define isascii ((unsigned)(x) < 0x80)
#endif
/* Error macros */
#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)
#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)
#define TRIO_ERROR_NAME(x) trio_strerror(x)
/*
* Error codes.
*
......@@ -53,14 +62,10 @@ enum {
TRIO_EDBLREF = 4,
TRIO_EGAP = 5,
TRIO_ENOMEM = 6,
TRIO_ERANGE = 7
TRIO_ERANGE = 7,
TRIO_ERRNO = 8
};
/* Error macros */
#define TRIO_ERROR_CODE(x) ((-(x)) & 0x00FF)
#define TRIO_ERROR_POSITION(x) ((-(x)) >> 8)
#define TRIO_ERROR_NAME(x) trio_strerror(x)
const char *trio_strerror(int);
/*************************************************************************
......@@ -183,13 +188,6 @@ int trio_sscanfv(const char *buffer, const char *format, void **args);
#define vdscanf trio_vdscanf
#endif
/* strio compatible names */
#define StrScan trio_sscanf
#define StrFormat trio_sprintf
#define StrFormatMax trio_snprintf
#define StrFormatAlloc trio_aprintf
#define StrFormatAppendMax trio_snprintfcat
#ifdef __cplusplus
} /* extern "C" */
#endif
......
......@@ -15,8 +15,8 @@
*
************************************************************************/
#ifndef __TRIO_TRIODEF_H__
#define __TRIO_TRIODEF_H__
#ifndef TRIO_TRIODEF_H
#define TRIO_TRIODEF_H
/*************************************************************************
* Platform and compiler support detection
......@@ -48,12 +48,17 @@
# define TRIO_PLATFORM_UNIX
#elif defined(__QNX__)
# define TRIO_PLATFORM_UNIX
# define TRIO_PLATFORM_QNX
#elif defined(__CYGWIN__)
# define TRIO_PLATFORM_UNIX
#elif defined(AMIGA) && defined(TRIO_COMPILER_GCC)
# define TRIO_PLATFORM_UNIX
#elif defined(TRIO_COMPILER_MSVC) || defined(WIN32) || defined(_WIN32)
# define TRIO_PLATFORM_WIN32
#elif defined(VMS) || defined(__VMS)
# define TRIO_PLATFORM_VMS
#elif defined(mpeix) || defined(__mpexl)
# define TRIO_PLATFORM_MPEIX
#endif
#if defined(__STDC__)
......@@ -81,4 +86,35 @@
# endif
#endif
#endif /* __TRIO_TRIODEF_H__ */
/*************************************************************************
* Generic defines
*/
#if !defined(TRIO_PUBLIC)
# define TRIO_PUBLIC
#endif
#if !defined(TRIO_PRIVATE)
# define TRIO_PRIVATE static
#endif
#if defined(TRIO_COMPILER_SUPPORTS_C90) || defined(__cplusplus)
# define TRIO_CONST const
# define TRIO_VOLATILE volatile
# define TRIO_POINTER void *
# define TRIO_PROTO(x) x
#else
# define TRIO_CONST
# define TRIO_VOLATILE
# define TRIO_POINTER char *
# define TRIO_PROTO(x) ()
#endif
#if defined(TRIO_COMPILER_SUPPORTS_C99) || defined(__cplusplus)
# define TRIO_INLINE inline
#elif defined(TRIO_COMPILER_GCC)
# define TRIO_INLINE __inline__
#else
# define TRIO_INLINE
#endif
#endif /* TRIO_TRIODEF_H */
......@@ -50,6 +50,7 @@
* NetBSD 1.4 x86 gcc
* NetBSD 1.4 StrongARM gcc
* NetBSD 1.5 Alpha gcc
* OpenVMS 7.1 Alpha DEC C 6.0
* RISC OS 4 StrongARM Norcroft C
* Solaris 2.5.1 x86 gcc
* Solaris 2.5.1 Sparc gcc
......@@ -63,7 +64,6 @@
static const char rcsid[] = "@(#)$Id$";
/*************************************************************************
* Include files
*/
......@@ -77,15 +77,17 @@ static const char rcsid[] = "@(#)$Id$";
#if defined(TRIO_PLATFORM_UNIX)
# include <signal.h>
#endif
#if defined(TRIO_COMPILER_DECC)
# include <fp_class.h>
#endif
#include <assert.h>
#ifdef __STDC__
# define CONST const
# define VOLATILE volatile
#else
# define CONST
# define VOLATILE
#if defined(TRIO_DOCUMENTATION)
# include "doc/doc_nan.h"
#endif
/** @addtogroup SpecialQuantities
@{
*/
/*************************************************************************
* Definitions
......@@ -94,7 +96,11 @@ static const char rcsid[] = "@(#)$Id$";
/* We must enable IEEE floating-point on Alpha */
#if defined(__alpha) && !defined(_IEEE_FP)
# if defined(TRIO_COMPILER_DECC)
# error "Must be compiled with option -ieee"
# if defined(TRIO_PLATFORM_VMS)
# error "Must be compiled with option /IEEE_MODE=UNDERFLOW_TO_ZERO/FLOAT=IEEE"
# else
# error "Must be compiled with option -ieee"
# endif
# elif defined(TRIO_COMPILER_GCC) && (defined(__osf__) || defined(__linux__))
# error "Must be compiled with option -mieee"
# endif
......@@ -128,57 +134,61 @@ static const char rcsid[] = "@(#)$Id$";
* Endian-agnostic indexing macro.
*
* The value of internalEndianMagic, when converted into a 64-bit
* integer, becomes 0x0001020304050607 (we could have used a 64-bit
* integer, becomes 0x0706050403020100 (we could have used a 64-bit
* integer value instead of a double, but not all platforms supports
* that type). The value is automatically encoded with the correct
* endianess by the compiler, which means that we can support any
* kind of endianess. The individual bytes are then used as an index
* for the IEEE 754 bit-patterns and masks.
*/
#define TRIO_DOUBLE_INDEX(x) (((unsigned char *)&internalEndianMagic)[(x)])
#define TRIO_DOUBLE_INDEX(x) (((unsigned char *)&internalEndianMagic)[7-(x)])
static CONST double internalEndianMagic = 1.4015997730788920e-309;
static TRIO_CONST double internalEndianMagic = 7.949928895127363e-275;
/* Mask for the exponent */
static CONST unsigned char ieee_754_exponent_mask[] = {
static TRIO_CONST unsigned char ieee_754_exponent_mask[] = {
0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* Mask for the mantissa */
static CONST unsigned char ieee_754_mantissa_mask[] = {
static TRIO_CONST unsigned char ieee_754_mantissa_mask[] = {
0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
};
/* Bit-pattern for infinity */
static CONST unsigned char ieee_754_infinity_array[] = {
static TRIO_CONST unsigned char ieee_754_infinity_array[] = {
0x7F, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/* Bit-pattern for quiet NaN */
static CONST unsigned char ieee_754_qnan_array[] = {
static TRIO_CONST unsigned char ieee_754_qnan_array[] = {
0x7F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
/*************************************************************************
* Functions
*/
/*
* trio_make_double
*/
static double
trio_make_double(CONST unsigned char *values)
TRIO_PRIVATE double
trio_make_double(TRIO_CONST unsigned char *values)
{
VOLATILE double result;
TRIO_VOLATILE double result;
int i;
for (i = 0; i < (int)sizeof(double); i++) {
((VOLATILE unsigned char *)&result)[TRIO_DOUBLE_INDEX(i)] = values[i];
((TRIO_VOLATILE unsigned char *)&result)[TRIO_DOUBLE_INDEX(i)] = values[i];
}
return result;
}
/*************************************************************************
/*
* trio_examine_double
*/
static int
TRIO_PRIVATE int
trio_is_special_quantity(double number,
int *has_mantissa)
{
......@@ -200,9 +210,11 @@ trio_is_special_quantity(double number,
#endif /* USE_IEEE_754 */
/*************************************************************************
* trio_pinf
*/
/**
Generate positive infinity.
@return Floating-point representation of positive infinity.
*/
TRIO_PUBLIC double
trio_pinf(void)
{
......@@ -242,9 +254,11 @@ trio_pinf(void)
return result;
}
/*************************************************************************
* trio_ninf
*/
/**
Generate negative infinity.
@return Floating-point value of negative infinity.
*/
TRIO_PUBLIC double
trio_ninf(void)
{
......@@ -261,9 +275,11 @@ trio_ninf(void)
return result;
}
/*************************************************************************
* trio_nan
*/
/**
Generate NaN.
@return Floating-point representation of NaN.
*/
TRIO_PUBLIC double
trio_nan(void)
{
......@@ -306,11 +322,14 @@ trio_nan(void)
return result;
}
/*************************************************************************
* trio_isnan
*/
/**
Check for NaN.
@param number An arbitrary floating-point number.
@return Boolean value indicating whether or not the number is a NaN.
*/
TRIO_PUBLIC int
trio_isnan(VOLATILE double number)
trio_isnan(TRIO_VOLATILE double number)
{
#if defined(isnan) || defined(TRIO_COMPILER_SUPPORTS_UNIX95)
/*
......@@ -370,11 +389,14 @@ trio_isnan(VOLATILE double number)
#endif
}
/*************************************************************************
* trio_isinf
*/
/**
Check for infinity.
@param number An arbitrary floating-point number.
@return 1 if positive infinity, -1 if negative infinity, 0 otherwise.
*/
TRIO_PUBLIC int
trio_isinf(VOLATILE double number)
trio_isinf(TRIO_VOLATILE double number)
{
#if defined(TRIO_COMPILER_DECC)
/*
......@@ -438,7 +460,15 @@ trio_isinf(VOLATILE double number)
#endif
}
/** @} SpecialQuantities */
/*************************************************************************
* For test purposes.
*
* Add the following compiler option to include this test code.
*
* Unix : -DSTANDALONE
* VMS : /DEFINE=(STANDALONE)
*/
#if defined(STANDALONE)
# include <stdio.h>
......
......@@ -15,50 +15,42 @@
*
************************************************************************/
#ifndef __TRIO_NAN_H__
#define __TRIO_NAN_H__
#ifndef TRIO_NAN_H
#define TRIO_NAN_H
#include "triodef.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TRIO_PUBLIC
#define TRIO_PUBLIC
#endif
/*
* Return NaN (Not-a-Number).
*/
TRIO_PUBLIC
double trio_nan(void);
TRIO_PUBLIC double trio_nan(void);
/*
* Return positive infinity.
*/
TRIO_PUBLIC
double trio_pinf(void);
TRIO_PUBLIC double trio_pinf(void);
/*
* Return negative infinity.
*/
TRIO_PUBLIC
double trio_ninf(void);
TRIO_PUBLIC double trio_ninf(void);
/*
* If number is a NaN return non-zero, otherwise return zero.
*/
TRIO_PUBLIC
int trio_isnan(double number);
TRIO_PUBLIC int trio_isnan(double number);
/*
* If number is positive infinity return 1, if number is negative
* infinity return -1, otherwise return 0.
*/
TRIO_PUBLIC
int trio_isinf(double number);
TRIO_PUBLIC int trio_isinf(double number);
#ifdef __cplusplus
}
#endif
#endif /* __TRIO_NAN_H__ */
#endif /* TRIO_NAN_H */
......@@ -27,6 +27,7 @@
#define TRIO_TRIOP_H
#include <stdlib.h>
#include <stdarg.h>
#ifdef __cplusplus
extern "C" {
......@@ -53,7 +54,7 @@ extern "C" {
#ifndef TRIO_EXTENSION
# define TRIO_EXTENSION 1
#endif
#ifndef TRIO_WIDECHAR
#ifndef TRIO_WIDECHAR /* Does not work yet. Do not enable */
# define TRIO_WIDECHAR 0
#endif
#ifndef TRIO_ERRORS
......@@ -70,7 +71,11 @@ extern "C" {
# define TRIO_FREE(x) free(x)
#endif
typedef int (*trio_callback_t)(void *ref);
/*************************************************************************
* User-defined specifiers
*/
typedef int (*trio_callback_t)(void *);
void *trio_register(trio_callback_t callback, const char *name);
void trio_unregister(void *handle);
......
This diff is collapsed.
/*************************************************************************
*
* $Id$
*
* Copyright (C) 2001 Bjorn Reese and Daniel Stenberg.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
*
************************************************************************/
#ifndef TRIO_TRIOSTR_H
#define TRIO_TRIOSTR_H
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "triodef.h"
#include "triop.h"
enum {
TRIO_HASH_NONE = 0,
TRIO_HASH_PLAIN,
TRIO_HASH_TWOSIGNED
};
/*************************************************************************
* String functions
*/
int trio_append(char *target, const char *source);
int trio_append_max(char *target, size_t max, const char *source);
int trio_contains(const char *string, const char *substring);
int trio_copy(char *target, const char *source);
int trio_copy_max(char *target, size_t max, const char *source);
char *trio_create(size_t size);
void trio_destroy(char *string);
char *trio_duplicate(const char *source);
char *trio_duplicate_max(const char *source, size_t max);
int trio_equal(const char *first, const char *second);
int trio_equal_case(const char *first, const char *second);
int trio_equal_case_max(const char *first, size_t max, const char *second);
int trio_equal_locale(const char *first, const char *second);
int trio_equal_max(const char *first, size_t max, const char *second);
const char *trio_error(int);
size_t trio_format_date_max(char *target, size_t max, const char *format, const struct tm *datetime);
unsigned long trio_hash(const char *string, int type);
char *trio_index(const char *string, char character);
char *trio_index_last(const char *string, char character);
size_t trio_length(const char *string);
int trio_lower(char *target);
int trio_match(const char *string, const char *pattern);
int trio_match_case(const char *string, const char *pattern);
size_t trio_span_function(char *target, const char *source, int (*Function)(int));
char *trio_substring(const char *string, const char *substring);
char *trio_substring_max(const char *string, size_t max, const char *substring);
char *trio_tokenize(char *string, const char *delimiters);
float trio_to_float(const char *source, const char **endp);
double trio_to_double(const char *source, const char **endp);
long trio_to_long(const char *source, char **endp, int base);
unsigned long trio_to_unsigned_long(const char *source, char **endp, int base);
int trio_upper(char *target);
/*************************************************************************
* Dynamic string functions
*/
/*
* Opaque type for dynamic strings
*/
typedef struct _trio_string_t trio_string_t;
trio_string_t *trio_string_create(int initial_size);
void trio_string_destroy(trio_string_t *self);
char *trio_string_get(trio_string_t *self, int offset);
void trio_xstring_set(trio_string_t *self, char *buffer);
char *trio_string_extract(trio_string_t *self);
int trio_string_size(trio_string_t *self);
void trio_string_terminate(trio_string_t *self);
int trio_string_append(trio_string_t *self, trio_string_t *other);
int trio_string_contains(trio_string_t *self, trio_string_t *other);
int trio_string_copy(trio_string_t *self, trio_string_t *other);
trio_string_t *trio_string_duplicate(