From c116e68a05e2feb9a0c8e735aab097ef5ea1dfb3 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Fri, 5 Mar 2010 22:33:03 +0100 Subject: Drop outdated documentation. Can be regenerated with Doxygen. --- trio/html/group___dynamic_strings.html | 362 ------ trio/html/group___printf.html | 1259 -------------------- trio/html/group___scanf.html | 145 --- trio/html/group___special_quantities.html | 390 ------- trio/html/group___static_strings.html | 1809 ----------------------------- trio/html/group___user_defined.html | 379 ------ trio/html/index.html | 88 -- trio/html/modules.html | 23 - trio/html/trio.css | 35 - 9 files changed, 4490 deletions(-) delete mode 100644 trio/html/group___dynamic_strings.html delete mode 100644 trio/html/group___printf.html delete mode 100644 trio/html/group___scanf.html delete mode 100644 trio/html/group___special_quantities.html delete mode 100644 trio/html/group___static_strings.html delete mode 100644 trio/html/group___user_defined.html delete mode 100644 trio/html/index.html delete mode 100644 trio/html/modules.html delete mode 100644 trio/html/trio.css diff --git a/trio/html/group___dynamic_strings.html b/trio/html/group___dynamic_strings.html deleted file mode 100644 index ab349297..00000000 --- a/trio/html/group___dynamic_strings.html +++ /dev/null @@ -1,362 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

Dynamic String Functions.

Dynamic string functions. -More... - - - - - - - - - - - - - - - -

Functions

TRIO_STRING_PUBLIC trio_string_t * trio_string_create (int initial_size)
 Create a new dynamic string. More...

TRIO_STRING_PUBLIC void trio_string_destroy (trio_string_t *self)
 Deallocate the dynamic string and its contents. More...

TRIO_STRING_PUBLIC char * trio_string_get (trio_string_t *self, int offset)
 Get a pointer to the content. More...

TRIO_STRING_PUBLIC char * trio_string_extract (trio_string_t *self)
 Extract the content. More...

TRIO_STRING_PUBLIC void trio_xstring_set (trio_string_t *self, char *buffer)
 Set the content of the dynamic string. More...

TRIO_STRING_PUBLIC int trio_string_append (trio_string_t *self, trio_string_t *other)
 Append the second string to the first. More...

TRIO_STRING_PUBLIC int trio_string_contains (trio_string_t *self, trio_string_t *other)
 Search for the first occurrence of second parameter in the first. More...

-

Detailed Description

-Dynamic string functions. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <triostr.h>
-
-

-DESCRIPTION


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_string_append trio_string_t *   self,
trio_string_t *   other
-
- - - - - -
-   - - -

-Append the second string to the first. -

-

-Parameters:
- - - -
self  -Dynamic string to be modified.
other  -Dynamic string to copy from.
-
-Returns:
-Boolean value indicating success or failure.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_string_contains trio_string_t *   self,
trio_string_t *   other
-
- - - - - -
-   - - -

-Search for the first occurrence of second parameter in the first. -

-

-Parameters:
- - - -
self  -Dynamic string to be modified.
other  -Dynamic string to copy from.
-
-Returns:
-Boolean value indicating success or failure.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC trio_string_t* trio_string_create int   initial_size
-
- - - - - -
-   - - -

-Create a new dynamic string. -

-

-Parameters:
- - -
initial_size  -Initial size of the buffer.
-
-Returns:
-Newly allocated dynamic string, or NULL if memory allocation failed.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC void trio_string_destroy trio_string_t *   self
-
- - - - - -
-   - - -

-Deallocate the dynamic string and its contents. -

-

-Parameters:
- - -
self  -Dynamic string
-
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_string_extract trio_string_t *   self
-
- - - - - -
-   - - -

-Extract the content. -

-

-Parameters:
- - -
self  -Dynamic String
-
-Returns:
-Content of dynamic string.
The content is removed from the dynamic string. This enables destruction of the dynamic string without deallocation of the content.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_string_get trio_string_t *   self,
int   offset
-
- - - - - -
-   - - -

-Get a pointer to the content. -

-

-Parameters:
- - - -
self  -Dynamic string.
offset  -Offset into content.
-
-Returns:
-Pointer to the content.
Offset can be zero, positive, or negative. If offset is zero, then the start of the content will be returned. If offset is positive, then a pointer to offset number of characters from the beginning of the content is returned. If offset is negative, then a pointer to offset number of characters from the ending of the string, starting at the terminating zero, is returned.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC void trio_xstring_set trio_string_t *   self,
char *   buffer
-
- - - - - -
-   - - -

-Set the content of the dynamic string. -

-

-Parameters:
- - - -
self  -Dynamic String
buffer  -The new content.
-
Sets the content of the dynamic string to a copy buffer. An existing content will be deallocated first, if necessary. -

-

-Remarks:
- This function will make a copy of buffer. You are responsible for deallocating buffer yourself.
-


- - - diff --git a/trio/html/group___printf.html b/trio/html/group___printf.html deleted file mode 100644 index 7f79200f..00000000 --- a/trio/html/group___printf.html +++ /dev/null @@ -1,1259 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

Formatted Printing Functions.

Variations of formatted printing functions. -More... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Functions

int trio_printf (const char *format,...)
 Print to standard output stream. More...

int trio_vprintf (const char *format, va_list args)
 Print to standard output stream. More...

int trio_printfv (const char *format, trio_pointer_t *args)
 Print to standard output stream. More...

int trio_fprintf (FILE *file, const char *format,...)
 Print to file. More...

int trio_vfprintf (FILE *file, const char *format, va_list args)
 Print to file. More...

int trio_fprintfv (FILE *file, const char *format, trio_pointer_t *args)
 Print to file. More...

int trio_dprintf (int fd, const char *format,...)
 Print to file descriptor. More...

int trio_vdprintf (int fd, const char *format, va_list args)
 Print to file descriptor. More...

int trio_dprintfv (int fd, const char *format, trio_pointer_t *args)
 Print to file descriptor. More...

int trio_sprintf (char *buffer, const char *format,...)
 Print to string. More...

int trio_vsprintf (char *buffer, const char *format, va_list args)
 Print to string. More...

int trio_sprintfv (char *buffer, const char *format, trio_pointer_t *args)
 Print to string. More...

int trio_snprintf (char *buffer, size_t max, const char *format,...)
 Print at most max characters to string. More...

int trio_vsnprintf (char *buffer, size_t max, const char *format, va_list args)
 Print at most max characters to string. More...

int trio_snprintfv (char *buffer, size_t max, const char *format, trio_pointer_t *args)
 Print at most max characters to string. More...

-

Detailed Description

-Variations of formatted printing functions. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <trio.h>
-
-

-DESCRIPTION -

-This documentation is incomplete. The documentation of the printf family in [C99] and [UNIX98] also applies to the trio counterparts. -

-All these functions outputs a string which is formatted according to the format string and the consecutive arguments. The format string is described in the Formatting section below. -

-trio_printf, trio_vprintf, and trio_printfv writes the output to the standard output stream (stdout). -

-trio_fprintf, trio_vfprintf, and trio_fprintfv writes the output to a given output stream. -

-trio_dprintf, trio_vdprintf, and trio_dprintfv writes the output to a file descriptor (this includes, for example, sockets). -

-trio_sprintf, trio_vsprintf, and trio_sprintfv writes the output into buffer. -

-trio_snprintf, trio_vsnprintf, and trio_snprintfv writes max - 1 characters into buffer followed by a terminating zero character. If max is 1, then buffer will be an empty string. If max is 0, then buffer is left untouched, and can consequently be NULL. The number of characters that would have been written to buffer, had there been sufficient space, is returned. -

-trio_snprintfcat appends the formatted text at the end of buffer. -

-trio_asprintf and trio_vasprintf allocates and returns an allocated string in buffer containing the formatted text. -

-FORMATTING -

-The format string can contain normal text and conversion indicators. The normal text can be any character except the nil character (\000 = '\0') and the percent character (\045 = '%'). Conversion indicators consists of an indication character (%), followed by zero or more conversion modifiers, and exactly one conversion specifier. -

-Modifiers -

-Some modifiers exhibit the same behaviour for all specifiers, other modifiers indicate different behaviours for different specifiers, and other modifiers are only applicable to certain specifiers. The relationship is described for each modifier. The number 9 is used to denotes an arbitrary integer. -

-Positional ( 9$ ) [UNIX98] -

-Normally the arguments supplied to these functions are interpreted incrementially from left to right. Arguments can be referenced specifically in the format string. The modifier n$ selects the nth argument. The first argument is referred as 1$. If this modifier is used, it must be the first modifier after the indication character. n$ can also be used for argument width, precision, and base. -

-The performance penalty of using positionals is almost neglible (contrary to most other printf implementations). -

-

- - -The following two statements are equivalent
-  trio_printf("|%d %s\n|", 42, "meanings");
-  |42 meanings|
-
-  trio_printf("|%1$d %2$s|\n", 42, "meanings");
-  |42 meanings|
-
-

-Width ( 9 ) -

-Specifies the minimum width of a field. If the fields has less characters than specified by the width, the field will be left adjusted and padded by spaces. The adjustment and padding can be changed by the Alignment ( - ) and Padding ( 0 ) modifiers. -

-The width is specified as a number. If an asterix ( * ) is used instead, the width will be read from the argument list. -

-Prefixes, such as 0x for hexadecimal integers, are part of width.

-  trio_printf("|%10i|\n", 42);
-  |        42|
-
-

-Precision ( .9 ) -

-The precision has different semantics for the various data types. The precision specifies the maximum number of printed characters for strings, the number of digits after the decimal-point for floating-point numbers, the number of significant digits for the g (and G) representation of floating-point numbers, the minimum number of printed digits for integers.

-  trio_printf("|%10.8i|%.8i|\n", 42, 42);
-  |  00000042|00000042|
-
-

-Base ( ..9 ) [TRIO] -

-Sets the base that the associated integer must be converted to. The base can be between 2 and 36 (both included).

-  trio_printf("|%10.8.2i|%10..2i|%..2i|\n", 42, 42, 42);
-  |  00101010|    101010|101010|
-
-  trio_printf("|%*.8.*i|\n", 10, 2, 42);
-  |  00101010|
-
-

-Padding ( 0 ) -

-Integer and floating point numbers are prepended by zeros. The number of leading zeros are determined by the precision. If precision is not present, width is used instead. -

-Short ( h ) -

-Integer arguments are read as an ( unsigned ) short int. String and character arguments are read as char * and char respectively. -

-Short short ( hh ) [C99, GNU] -

-The argument is read as an ( unsigned ) char. -

-Fixed Size ( I ) [MSVC] -

-The argument is read as a fixed sized integer. The modifier is followed by a number, which specifies the number of bits in the integer, and can be one of the following -

-

-Works only for integers (i, u, d, o, x, X) -

-Largest ( j ) [C99] -

-The argument is read as an intmax_t / uintmax_t, which is defined to be the largest signed/unsigned integer. -

-Long ( l ) -

-An integral argument is read as an ( unsigned ) long int. A string argument is read as a wchar_t *, and output as a multi-byte character sequence. -

-Long long ( ll ) [C99, UNIX98, GNU] -

-The argument is read as an ( unsigned ) long long int. -

-Long double ( L ) [C99, UNIX98, GNU] -

-The argument is read as a long double. -

-ptrdiff_t ( t ) [C99] -

-The argument is read as a ptrdiff_t, which is defined to be the signed integer type of the result of subtracting two pointers. -

-Quad ( q ) [BSD, GNU] -

-Corresponds to the long long modifier ( ll ). -

-Wide ( w ) [MISC] -

-For a string argument this is equivalent to using the long modifier ( l ). -

-size_t ( z ) [C99] -

-The argument is read as a size_t, which is defined to be the type returned by the sizeof operator. -

-size_t ( Z ) [GNU] -

-Corresponds to the size_t modifier ( z ). -

-Alternative ( # ) -

-Prepend radix indicator for hexadecimal, octal, and binary integer numbers and for pointers. Always add a decimal-pointer for floating-point numbers. Escape non-printable characters for strings. -

-Spacing ( ) -

-Prepend leading spaces when necessary. -

-Sign ( + ) -

-Always prepend a sign to numbers. Normally only the negative sign is prepended to a number. With this modifier the positive sign may also be prepended. -

-Alignment ( - ) -

-The output will be left-justified in the field specified by the width. -

-Argument ( * ) -

-Width, precision, or base is read from the argument list, rather than from the formatting string. -

-Quote / Grouping ( ' ) [MISC] -

-Groups integers and the integer-part of floating-point numbers according to the locale. Quote strings and characters. -

-Sticky ( ! ) [TRIO] -

-The modifiers listed for the current specifier will be reused by subsequent specifiers of the same group. The following specifier groups exists

-The sticky modifiers are active until superseeded by other sticky modifiers, or the end of the format string is reached. Local modifiers overrides sticky modifiers for the given specifier only.
-  trio_printf("|%!08#x|%04x|%x|\n", 42, 42, 42);
-  |0x00002a|0x2a|0x00002a|
-
-

-Specifiers -

-Percent ( % ) -

-Produce a percent ( % ) character. This is used to quote the indication character. No modifiers are allowed. The full syntax is %%.

-  trio_printf("Percent is %%\n");
-  Percent is %
-
-

-Hex floats ( a, A ) [C99] -

-Output a hexadecimal (base 16) representation of a floating point number. The number is automatically preceeded by 0x ( or 0X ). The exponent is p ( or P ).

-  trio_printf("|%a|%A|\n", 3.1415, 3.1415e20);
-  |0x3.228bc|0X3.228BCP+14|
-
-

-Binary numbers ( b, B ) [MISC - SCO UnixWare 7] -

-DEPRECATED: Use Base modifier %..2i instead. -

-Character ( c ) -

-Output a single character. -

-

-Decimal ( d ) -

-Output a decimal (base 10) representation of a number. -

-

-Floating-point ( e, E) -

-Output a decimal floating-point number. The style is [-]9.99e[-]9, where

-If the precision is wider than the maximum number of digits that can be represented by the floating-point unit, then the number will be adequately rounded. For example, assuming DBL_DIG is 15
-  trio_printf("|%.18e|\n", (1.0 / 3.0));
-  |3.333333333333333000e-01|
-
-

-Floating-point ( f, F ) -

-Output a decimal floating-point number. The style is [-]9.99, where

-If more digits are needed to output the number, than can be represented with the accuracy of the floating-point unit, then the number will be adequately rounded. For example, assuming that DBL_DIG is 15
-  trio_printf("|%f|\n", (2.0 / 3.0) * 1E18);
-  |666666666666666700.000000|
-
-

-The following modifiers holds a special meaning for this specifier

-Floating-point ( g, G) -

-Output a decimal floating-point representation of a number. The format of either the f, F specifier or the e, E specifier is used, whatever produces the shortest result. -

-Integer ( i ) -

-Output a signed integer. Default base is 10. -

-Errno ( m ) [GNU] -

-Count ( n ) -

-Insert into the location pointed to by the argument, the number of octets written to the output so far. -

-Octal ( o ) -

-Output an octal (base 8) representation of a number. -

-Pointer ( p ) -

-Ouput the address of the argument. The address is printed as a hexadecimal number. If the argument is the NULL pointer the text (nil) will be used instead.

-String ( s, S ) -

-Output a string. The argument must point to a zero terminated string. If the argument is the NULL pointer the text (nil) will be used instead. S is equivalent to ls.

-Non-printable characters are converted into C escapes, or hexadecimal numbers where no C escapes exists for the character. The C escapes, the hexadecimal number, and all backslashes are prepended by a backslash ( \ ). The supported C escapes are -
-  trio_printf("|One %s Three|One %'s Three|\n", "Two", "Two");
-  |One Two Three|One "Two" Three|
-
-  trio_printf("|Argument missing %s|\n", NULL);
-  |Argument missing (nil)|
-
-  trio_printf("|%#s|\n", "\007 \a.");
-  |\a \a.|
-
-

-Unsigned ( u ) -

-Output an unsigned integer. Default base is 10. -

-Hex ( x, X ) -

-Output a hexadecimal (base 16) representation of a number. -

-

-User-defined ( <> ) -

-Invoke user-defined formatting. See trio_register for further information. -

-RETURN VALUES -

-All functions returns the number of outputted characters. If an error occured then a negative error code is returned [TRIO]. Note that this is a deviation from the standard, which simply returns -1 (or EOF) and errno set appropriately. The error condition can be detected by checking whether the function returns a negative number or not, and the number can be parsed with the following macros. The error codes are primarily intended as debugging aide for the developer. -

-

-Example:
-  int rc;
-
-  rc = trio_printf("%r\n", 42);
-  if (rc < 0) {
-    if (TRIO_ERROR_CODE(rc) != TRIO_EOF) {
-      trio_printf("Error: %s at position %d\n",
-                  TRIO_ERROR_NAME(rc),
-                  TRIO_ERROR_POSITION(rc));
-    }
-  }
-
-

-SEE ALSO -

-trio_scanf, trio_register. -

-NOTES -

-The printfv family uses an array rather than the stack to pass arguments. This means that short int and float values will not be handled by the default argument promotion in C. Instead, these values must be explicitly converted with the Short (h) modifier in both cases. -

-Example:

-  void *array[2];
-  float float_number = 42.0;
-  short short_number = 42;
-
-  array[0] = &float_number;
-  array[1] = &short_number;
-
-  trio_printfv("%hf %hd\n", array); /* CORRECT */
-  trio_printfv("%f %d\n", array); /* WRONG */
-
-

-CONFORMING TO -

-Throughout this document the following abbreviations have been used to indicate what standard a feature conforms to. If nothing else is indicated ANSI C (C89) is assumed. -

-

-

Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_dprintf int   fd,
const char *   format,
...  
-
- - - - - -
-   - - -

-Print to file descriptor. -

-

-Parameters:
- - - - -
fd  -File descriptor.
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_dprintfv int   fd,
const char *   format,
trio_pointer_t *   args
-
- - - - - -
-   - - -

-Print to file descriptor. -

-

-Parameters:
- - - - -
fd  -File descriptor.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_fprintf FILE *   file,
const char *   format,
...  
-
- - - - - -
-   - - -

-Print to file. -

-

-Parameters:
- - - - -
file  -File pointer.
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_fprintfv FILE *   file,
const char *   format,
trio_pointer_t *   args
-
- - - - - -
-   - - -

-Print to file. -

-

-Parameters:
- - - - -
file  -File pointer.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
int trio_printf const char *   format,
...  
-
- - - - - -
-   - - -

-Print to standard output stream. -

-

-Parameters:
- - - -
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
int trio_printfv const char *   format,
trio_pointer_t *   args
-
- - - - - -
-   - - -

-Print to standard output stream. -

-

-Parameters:
- - - -
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_snprintf char *   buffer,
size_t   max,
const char *   format,
...  
-
- - - - - -
-   - - -

-Print at most max characters to string. -

-

-Parameters:
- - - - - -
buffer  -Output string.
max  -Maximum number of characters to print.
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_snprintfv char *   buffer,
size_t   max,
const char *   format,
trio_pointer_t *   args
-
- - - - - -
-   - - -

-Print at most max characters to string. -

-

-Parameters:
- - - - - -
buffer  -Output string.
max  -Maximum number of characters to print.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_sprintf char *   buffer,
const char *   format,
...  
-
- - - - - -
-   - - -

-Print to string. -

-

-Parameters:
- - - - -
buffer  -Output string.
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_sprintfv char *   buffer,
const char *   format,
trio_pointer_t *   args
-
- - - - - -
-   - - -

-Print to string. -

-

-Parameters:
- - - - -
buffer  -Output string.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_vdprintf int   fd,
const char *   format,
va_list   args
-
- - - - - -
-   - - -

-Print to file descriptor. -

-

-Parameters:
- - - - -
fd  -File descriptor.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_vfprintf FILE *   file,
const char *   format,
va_list   args
-
- - - - - -
-   - - -

-Print to file. -

-

-Parameters:
- - - - -
file  -File pointer.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
int trio_vprintf const char *   format,
va_list   args
-
- - - - - -
-   - - -

-Print to standard output stream. -

-

-Parameters:
- - - -
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_vsnprintf char *   buffer,
size_t   max,
const char *   format,
va_list   args
-
- - - - - -
-   - - -

-Print at most max characters to string. -

-

-Parameters:
- - - - - -
buffer  -Output string.
max  -Maximum number of characters to print.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
int trio_vsprintf char *   buffer,
const char *   format,
va_list   args
-
- - - - - -
-   - - -

-Print to string. -

-

-Parameters:
- - - - -
buffer  -Output string.
format  -Formatting string.
args  -Arguments.
-
-Returns:
-Number of printed characters.
-


- - - diff --git a/trio/html/group___scanf.html b/trio/html/group___scanf.html deleted file mode 100644 index 0c8d9d2b..00000000 --- a/trio/html/group___scanf.html +++ /dev/null @@ -1,145 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

Formatted Scanning Functions.

Variations of formatted scanning functions. -More... - - - -

Functions

int trio_scanf (const char *format,...)
 Scan characters from standard input stream. More...

-

Detailed Description

-Variations of formatted scanning functions. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <trio.h>
-
-

-DESCRIPTION -

-This documentation is incomplete. The documentation of the scanf family in [C99] and [UNIX98] also applies to the trio counterparts. -

-SCANNING -

-The scanning is controlled by the format string. The format string can contain normal text and conversion indicators. The normal text can be any character except the nil character (\000) and the percent character (\045 = '%'). Conversion indicators consists of an indication character (%), followed by zero or more conversion modifiers, and exactly one conversion specifier. -

-Modifiers -

-Positional ( 9$ ) [UNIX98] -

-See trio_printf. -

-Specifiers -

-Percent ( % ) -

-Character ( c ) -

-Decimal ( d ) -

-Floating-point ( a, A, e, E, f, F, g, G ) -

-Integer ( i ) -

-Count ( n ) -

-Octal ( o ) -

-Pointer ( p ) -

-String ( s ) -

-Unsigned ( u ) -

-Hex ( x, X ) -

-Scanlist ( [] ) -

-Scanlist Exclusion (^ ) -

-Scanlist Range ( - ) [TRIO] -

-

-Scanlist Equivalence Class Expression ( [= =] ) [TRIO] -

-Locale dependent (LC_COLLATE). Only one expression can appear inside the delimiters.

-Scanlist Character Class Expression ( [: :]) [TRIO] Locale dependent (LC_CTYPE). Only one expression can appear inside the delimiters. -RETURN VALUES -

-SEE ALSO -

-trio_printf


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - -
int trio_scanf const char *   format,
...  
-
- - - - - -
-   - - -

-Scan characters from standard input stream. -

-

-Parameters:
- - - -
format  -Formatting string.
...  -Arguments.
-
-Returns:
-Number of scanned characters.
-


- - - diff --git a/trio/html/group___special_quantities.html b/trio/html/group___special_quantities.html deleted file mode 100644 index cdc294f2..00000000 --- a/trio/html/group___special_quantities.html +++ /dev/null @@ -1,390 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

Special Quantifies.

Functions to detect and fabricate special quantities in floating-point numbers. -More... - - - - - - - - - - - - - - - - - - - -

Functions

double trio_nzero (void)
 Generate negative zero. More...

double trio_pinf (void)
 Generate positive infinity. More...

double trio_ninf (void)
 Generate negative infinity. More...

double trio_nan (void)
 Generate NaN. More...

int trio_isnan (double number)
 Check for NaN. More...

int trio_isinf (double number)
 Check for infinity. More...

int trio_isfinite (double number)
 Check for finity. More...

int trio_signbit (double number)
 Examine the sign of a number. More...

int trio_fpclassify (double number)
 Examine the class of a number. More...

-

Detailed Description

-Functions to detect and fabricate special quantities in floating-point numbers. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <trionan.h>
-
-

-DESCRIPTION -

-Certain arithmetical operations does not result in normal numbers. Instead they result in special quantities that must be handled differently by the floating-point hardware. These includes Infinity and Not-A-Number (NaN). -

-For example, 0/0 (zero divided by zero) yields NaN. Any operation which involves a NaN will result in NaN. Any comparison involving NaN will be unsuccessful, even if NaN is compared to NaN. -

-These special quantities are represented with special bit patterns by the floating-point hardware, and this bit patterns depend on the hardware. There may even be hardware that does not support special quantities, so the functions in this module are not guaranteed to work on all platforms. -

-The approach used in this module is to (in decreasing order of importance)

-NOTES -

-This module does not depend on the rest of trio, and can thus be reused separately. The following files are necessary:

-

Function Documentation

-

- - - - -
- - - - - - - - - - -
int trio_fpclassify double   number
-
- - - - - -
-   - - -

-Examine the class of a number. -

-

-Parameters:
- - -
number  -An arbitrary floating-point number.
-
-Returns:
-Enumerable value indicating the class of number
-

- - - - -
- - - - - - - - - - -
int trio_isfinite double   number
-
- - - - - -
-   - - -

-Check for finity. -

-

-Parameters:
- - -
number  -An arbitrary floating-point number.
-
-Returns:
-Boolean value indicating whether or not the number is a finite.
-

- - - - -
- - - - - - - - - - -
int trio_isinf double   number
-
- - - - - -
-   - - -

-Check for infinity. -

-

-Parameters:
- - -
number  -An arbitrary floating-point number.
-
-Returns:
-1 if positive infinity, -1 if negative infinity, 0 otherwise.
-

- - - - -
- - - - - - - - - - -
int trio_isnan double   number
-
- - - - - -
-   - - -

-Check for NaN. -

-

-Parameters:
- - -
number  -An arbitrary floating-point number.
-
-Returns:
-Boolean value indicating whether or not the number is a NaN.
-

- - - - -
- - - - - - - - - - -
double trio_nan void  
-
- - - - - -
-   - - -

-Generate NaN. -

-

-Returns:
-Floating-point representation of NaN.
-

- - - - -
- - - - - - - - - - -
double trio_ninf void  
-
- - - - - -
-   - - -

-Generate negative infinity. -

-

-Returns:
-Floating-point value of negative infinity.
-

- - - - -
- - - - - - - - - - -
double trio_nzero void  
-
- - - - - -
-   - - -

-Generate negative zero. -

-

-Returns:
-Floating-point representation of negative zero.
-

- - - - -
- - - - - - - - - - -
double trio_pinf void  
-
- - - - - -
-   - - -

-Generate positive infinity. -

-

-Returns:
-Floating-point representation of positive infinity.
-

- - - - -
- - - - - - - - - - -
int trio_signbit double   number
-
- - - - - -
-   - - -

-Examine the sign of a number. -

-

-Parameters:
- - -
number  -An arbitrary floating-point number.
-
-Returns:
-Boolean value indicating whether or not the number has the sign bit set (i.e. is negative).
-


- - - diff --git a/trio/html/group___static_strings.html b/trio/html/group___static_strings.html deleted file mode 100644 index 840f36a5..00000000 --- a/trio/html/group___static_strings.html +++ /dev/null @@ -1,1809 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

Static String Functions.

Replacements for the standard C string functions. -More... - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Functions

TRIO_STRING_PUBLIC char * trio_create (size_t size)
 Create new string. More...

TRIO_STRING_PUBLIC void trio_destroy (char *string)
 Destroy string. More...

TRIO_STRING_PUBLIC size_t trio_length (const char *string)
 Count the number of characters in a string. More...

TRIO_STRING_PUBLIC int trio_append (char *target, const char *source)
 Append source at the end of target. More...

TRIO_STRING_PUBLIC int trio_append_max (char *target, size_t max, const char *source)
 Append at most max characters from source to target. More...

TRIO_STRING_PUBLIC int trio_contains (const char *string, const char *substring)
 Determine if a string contains a substring. More...

TRIO_STRING_PUBLIC int trio_copy (char *target, const char *source)
 Copy source to target. More...

TRIO_STRING_PUBLIC int trio_copy_max (char *target, size_t max, const char *source)
 Copy at most max characters from source to target. More...

TRIO_STRING_PUBLIC char * trio_duplicate (const char *source)
 Duplicate source. More...

TRIO_STRING_PUBLIC char * trio_duplicate_max (const char *source, size_t max)
 Duplicate at most max characters of source. More...

TRIO_STRING_PUBLIC int trio_equal (const char *first, const char *second)
 Compare if two strings are equal. More...

TRIO_STRING_PUBLIC int trio_equal_case (const char *first, const char *second)
 Compare if two strings are equal. More...

TRIO_STRING_PUBLIC int trio_equal_case_max (const char *first, size_t max, const char *second)
 Compare if two strings up until the first max characters are equal. More...

TRIO_STRING_PUBLIC int trio_equal_locale (const char *first, const char *second)
 Compare if two strings are equal. More...

TRIO_STRING_PUBLIC int trio_equal_max (const char *first, size_t max, const char *second)
 Compare if two strings up until the first max characters are equal. More...

TRIO_STRING_PUBLIC const char * trio_error (int error_number)
 Provide a textual description of an error code (errno). More...

TRIO_STRING_PUBLIC size_t trio_format_date_max (char *target, size_t max, const char *format, const struct tm *datetime)
 Format the date/time according to format. More...

TRIO_STRING_PUBLIC unsigned
-long 
trio_hash (const char *string, int type)
 Calculate a hash value for a string. More...

TRIO_STRING_PUBLIC char * trio_index (const char *string, int character)
 Find first occurrence of a character in a string. More...

TRIO_STRING_PUBLIC char * trio_index_last (const char *string, int character)
 Find last occurrence of a character in a string. More...

TRIO_STRING_PUBLIC int trio_lower (char *target)
 Convert the alphabetic letters in the string to lower-case. More...

TRIO_STRING_PUBLIC int trio_match (const char *string, const char *pattern)
 Compare two strings using wildcards. More...

TRIO_STRING_PUBLIC int trio_match_case (const char *string, const char *pattern)
 Compare two strings using wildcards. More...

TRIO_STRING_PUBLIC size_t trio_span_function (char *target, const char *source, int(*Function)(int))
 Execute a function on each character in string. More...

TRIO_STRING_PUBLIC char * trio_substring (const char *string, const char *substring)
 Search for a substring in a string. More...

TRIO_STRING_PUBLIC char * trio_substring_max (const char *string, size_t max, const char *substring)
 Search for a substring in the first max characters of a string. More...

TRIO_STRING_PUBLIC char * trio_tokenize (char *string, const char *delimiters)
 Tokenize string. More...

TRIO_STRING_PUBLIC trio_long_double_t trio_to_long_double (const char *source, char **endp)
 Convert string to floating-point number. More...

TRIO_STRING_PUBLIC double trio_to_double (const char *source, char **endp)
 Convert string to floating-point number. More...

TRIO_STRING_PUBLIC float trio_to_float (const char *source, char **endp)
 Convert string to floating-point number. More...

TRIO_STRING_PUBLIC long trio_to_long (const char *string, char **endp, int base)
 Convert string to signed integer. More...

TRIO_STRING_PUBLIC unsigned
-long 
trio_to_unsigned_long (const char *string, char **endp, int base)
 Convert string to unsigned integer. More...

TRIO_STRING_PUBLIC int trio_upper (char *target)
 Convert the alphabetic letters in the string to upper-case. More...

-

Detailed Description

-Replacements for the standard C string functions. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <triostr.h>
-
-

-DESCRIPTION -

-This package renames, fixes, and extends the standard C string handling functions. -

-Naming -

-Renaming is done to provide more clear names, to provide a consistant naming and argument policy, and to hide portability issues. -

-

-Fixing -

-Fixing is done to avoid subtle error conditions. For example, strncpy does not terminate the result with a zero if the source string is bigger than the maximal length, so technically the result is not a C string anymore. trio_copy_max makes sure that the result is zero terminated. -

-Extending -

-Extending is done to provide a richer set of fundamental functions. This includes functionality such as wildcard matching ( trio_match ) and calculation of hash values ( trio_hash ).


Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_append char *   target,
const char *   source
-
- - - - - -
-   - - -

-Append source at the end of target. -

-

-Parameters:
- - - -
target  -Target string.
source  -Source string.
-
-Returns:
-Boolean value indicating success or failure.
-Precondition:
-target must point to a memory chunk with sufficient room to contain the target string and source string.
-No boundary checking is performed, so insufficient memory will result in a buffer overrun.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_append_max char *   target,
size_t   max,
const char *   source
-
- - - - - -
-   - - -

-Append at most max characters from source to target. -

-

-Parameters:
- - - - -
target  -Target string.
max  -Maximum number of characters to append.
source  -Source string.
-
-Returns:
-Boolean value indicating success or failure.
-Precondition:
-target must point to a memory chuck with sufficient room to contain the target string and the source string (at most max characters).
-No boundary checking is performed, so insufficient memory will result in a buffer overrun.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_contains const char *   string,
const char *   substring
-
- - - - - -
-   - - -

-Determine if a string contains a substring. -

-

-Parameters:
- - - -
string  -String to be searched.
substring  -String to be found.
-
-Returns:
-Boolean value indicating success or failure.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_copy char *   target,
const char *   source
-
- - - - - -
-   - - -

-Copy source to target. -

-

-Parameters:
- - - -
target  -Target string.
source  -Source string.
-
-Returns:
-Boolean value indicating success or failure.
-Precondition:
-target must point to a memory chunk with sufficient room to contain the source string.
-No boundary checking is performed, so insufficient memory will result in a buffer overrun.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_copy_max char *   target,
size_t   max,
const char *   source
-
- - - - - -
-   - - -

-Copy at most max characters from source to target. -

-

-Parameters:
- - - - -
target  -Target string.
max  -Maximum number of characters to append.
source  -Source string.
-
-Returns:
-Boolean value indicating success or failure.
-Precondition:
-target must point to a memory chunk with sufficient room to contain the source string (at most max characters).
-No boundary checking is performed, so insufficient memory will result in a buffer overrun.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_create size_t   size
-
- - - - - -
-   - - -

-Create new string. -

-

-Parameters:
- - -
size  -Size of new string.
-
-Returns:
-Pointer to string, or NULL if allocation failed.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC void trio_destroy char *   string
-
- - - - - -
-   - - -

-Destroy string. -

-

-Parameters:
- - -
string  -String to be freed.
-
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_duplicate const char *   source
-
- - - - - -
-   - - -

-Duplicate source. -

-

-Parameters:
- - -
source  -Source string.
-
-Returns:
-A copy of the source string.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_duplicate_max const char *   source,
size_t   max
-
- - - - - -
-   - - -

-Duplicate at most max characters of source. -

-

-Parameters:
- - - -
source  -Source string.
max  -Maximum number of characters to duplicate.
-
-Returns:
-A copy of the source string.
-Postcondition:
-target will be zero terminated.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_equal const char *   first,
const char *   second
-
- - - - - -
-   - - -

-Compare if two strings are equal. -

-

-Parameters:
- - - -
first  -First string.
second  -Second string.
-
-Returns:
-Boolean indicating whether the two strings are equal or not.
Case-insensitive comparison.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_equal_case const char *   first,
const char *   second
-
- - - - - -
-   - - -

-Compare if two strings are equal. -

-

-Parameters:
- - - -
first  -First string.
second  -Second string.
-
-Returns:
-Boolean indicating whether the two strings are equal or not.
Case-sensitive comparison.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_equal_case_max const char *   first,
size_t   max,
const char *   second
-
- - - - - -
-   - - -

-Compare if two strings up until the first max characters are equal. -

-

-Parameters:
- - - - -
first  -First string.
max  -Maximum number of characters to compare.
second  -Second string.
-
-Returns:
-Boolean indicating whether the two strings are equal or not.
Case-sensitive comparison.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_equal_locale const char *   first,
const char *   second
-
- - - - - -
-   - - -

-Compare if two strings are equal. -

-

-Parameters:
- - - -
first  -First string.
second  -Second string.
-
-Returns:
-Boolean indicating whether the two strings are equal or not.
Collating characters are considered equal.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_equal_max const char *   first,
size_t   max,
const char *   second
-
- - - - - -
-   - - -

-Compare if two strings up until the first max characters are equal. -

-

-Parameters:
- - - - -
first  -First string.
max  -Maximum number of characters to compare.
second  -Second string.
-
-Returns:
-Boolean indicating whether the two strings are equal or not.
Case-insensitive comparison.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC const char* trio_error int   error_number
-
- - - - - -
-   - - -

-Provide a textual description of an error code (errno). -

-

-Parameters:
- - -
error_number  -Error number.
-
-Returns:
-Textual description of error_number.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC size_t trio_format_date_max char *   target,
size_t   max,
const char *   format,
const struct tm *   datetime
-
- - - - - -
-   - - -

-Format the date/time according to format. -

-

-Parameters:
- - - - - -
target  -Target string.
max  -Maximum number of characters to format.
format  -Formatting string.
datetime  -Date/time structure.
-
-Returns:
-Number of formatted characters.
The formatting string accepts the same specifiers as the standard C function strftime.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC unsigned long trio_hash const char *   string,
int   type
-
- - - - - -
-   - - -

-Calculate a hash value for a string. -

-

-Parameters:
- - - -
string  -String to be calculated on.
type  -Hash function.
-
-Returns:
-Calculated hash value.
type can be one of the following
    -
  • TRIO_HASH_PLAIN Plain hash function.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_index const char *   string,
int   character
-
- - - - - -
-   - - -

-Find first occurrence of a character in a string. -

-

-Parameters:
- - - - -
string  -String to be searched.
character  -Character to be found.
A  -pointer to the found character, or NULL if character was not found.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_index_last const char *   string,
int   character
-
- - - - - -
-   - - -

-Find last occurrence of a character in a string. -

-

-Parameters:
- - - - -
string  -String to be searched.
character  -Character to be found.
A  -pointer to the found character, or NULL if character was not found.
-
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC size_t trio_length const char *   string
-
- - - - - -
-   - - -

-Count the number of characters in a string. -

-

-Parameters:
- - -
string  -String to measure.
-
-Returns:
-Number of characters in @string.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_lower char *   target
-
- - - - - -
-   - - -

-Convert the alphabetic letters in the string to lower-case. -

-

-Parameters:
- - -
target  -String to be converted.
-
-Returns:
-Number of processed characters (converted or not).
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_match const char *   string,
const char *   pattern
-
- - - - - -
-   - - -

-Compare two strings using wildcards. -

-

-Parameters:
- - - -
string  -String to be searched.
pattern  -Pattern, including wildcards, to search for.
-
-Returns:
-Boolean value indicating success or failure.
Case-insensitive comparison. -

-The following wildcards can be used

    -
  • * Match any number of characters.
  • ? Match a single character.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_match_case const char *   string,
const char *   pattern
-
- - - - - -
-   - - -

-Compare two strings using wildcards. -

-

-Parameters:
- - - -
string  -String to be searched.
pattern  -Pattern, including wildcards, to search for.
-
-Returns:
-Boolean value indicating success or failure.
Case-sensitive comparison. -

-The following wildcards can be used

    -
  • * Match any number of characters.
  • ? Match a single character.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC size_t trio_span_function char *   target,
const char *   source,
int(*   Function)(int)
-
- - - - - -
-   - - -

-Execute a function on each character in string. -

-

-Parameters:
- - - - -
target  -Target string.
source  -Source string.
Function  -Function to be executed.
-
-Returns:
-Number of processed characters.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_substring const char *   string,
const char *   substring
-
- - - - - -
-   - - -

-Search for a substring in a string. -

-

-Parameters:
- - - -
string  -String to be searched.
substring  -String to be found.
-
-Returns:
-Pointer to first occurrence of substring in string, or NULL if no match was found.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_substring_max const char *   string,
size_t   max,
const char *   substring
-
- - - - - -
-   - - -

-Search for a substring in the first max characters of a string. -

-

-Parameters:
- - - - -
string  -String to be searched.
max  -Maximum characters to be searched.
substring  -String to be found.
-
-Returns:
-Pointer to first occurrence of substring in string, or NULL if no match was found.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC double trio_to_double const char *   source,
char **   endp
-
- - - - - -
-   - - -

-Convert string to floating-point number. -

-

-Parameters:
- - - -
source  -String to be converted.
endp  -Pointer to end of the converted string.
-
-Returns:
-A floating-point number.
See trio_to_long_double.
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC float trio_to_float const char *   source,
char **   endp
-
- - - - - -
-   - - -

-Convert string to floating-point number. -

-

-Parameters:
- - - -
source  -String to be converted.
endp  -Pointer to end of the converted string.
-
-Returns:
-A floating-point number.
See trio_to_long_double.
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC long trio_to_long const char *   string,
char **   endp,
int   base
-
- - - - - -
-   - - -

-Convert string to signed integer. -

-

-Parameters:
- - - - -
string  -String to be converted.
endp  -Pointer to end of converted string.
base  -Radix number of number.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC trio_long_double_t trio_to_long_double const char *   source,
char **   endp
-
- - - - - -
-   - - -

-Convert string to floating-point number. -

-

-Parameters:
- - - -
source  -String to be converted.
endp  -Pointer to end of the converted string.
-
-Returns:
-A floating-point number.
The following Extended Backus-Naur form is used
-   double        ::= [ <sign> ]
-                     ( <number> |
-                       <number> <decimal_point> <number> |
-                       <decimal_point> <number> )
-                     [ <exponential> [ <sign> ] <number> ]
-   number        ::= 1*( <digit> )
-   digit         ::= ( '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' )
-   exponential   ::= ( 'e' | 'E' )
-   sign          ::= ( '-' | '+' )
-   decimal_point ::= '.'
-   
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC unsigned long trio_to_unsigned_long const char *   string,
char **   endp,
int   base
-
- - - - - -
-   - - -

-Convert string to unsigned integer. -

-

-Parameters:
- - - - -
string  -String to be converted.
endp  -Pointer to end of converted string.
base  -Radix number of number.
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - -
TRIO_STRING_PUBLIC char* trio_tokenize char *   string,
const char *   delimiters
-
- - - - - -
-   - - -

-Tokenize string. -

-

-Parameters:
- - - -
string  -String to be tokenized.
tokens  -String containing list of delimiting characters.
-
-Returns:
-Start of new token.
-Warning:
-string will be destroyed.
-

- - - - -
- - - - - - - - - - -
TRIO_STRING_PUBLIC int trio_upper char *   target
-
- - - - - -
-   - - -

-Convert the alphabetic letters in the string to upper-case. -

-

-Parameters:
- - -
target  -The string to be converted.
-
-Returns:
-The number of processed characters (converted or not).
-


- - - diff --git a/trio/html/group___user_defined.html b/trio/html/group___user_defined.html deleted file mode 100644 index b2507275..00000000 --- a/trio/html/group___user_defined.html +++ /dev/null @@ -1,379 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

User-defined Formatted Printing Functions.

Functions for using customized formatting specifiers. -More... - - - - - -

Functions

trio_pointer_t trio_register (trio_callback_t callback, const char *name)
 Register new user-defined specifier. More...

void trio_unregister (trio_pointer_t handle)
 Unregister an existing user-defined specifier. More...

-

Detailed Description

-Functions for using customized formatting specifiers. -

-SYNOPSIS -

-

-cc ... -ltrio -lm
-
-#include <trio.h>
-#include <triop.h>
-
-

-DESCRIPTION -

-This documentation is incomplete. -

-User-defined Specifier -

-The user-defined specifier consists of a start character (\074 = '<'), an optional namespace string followed by a namespace separator (\072 = ':'), a format string, and an end character (\076 = '>'). -

-The namespace string can consist of alphanumeric characters, and is used to define a named reference (see below). The namespace is case-sensitive. If no namespace is specified, then we use an unnamed reference (see below). -

-The format can consist of any character except the end character ('>'), the namespace separator (':'), and the nil character (\000). -

-Any modifier can be used together with the user-defined specifier. -

-Registering -

-A user-defined specifier must be registered before it can be used. Unregistered user-defined specifiers are ignored. The trio_register function is used to register a user-defined specifier. It takes two argument, a callback function and a namespace, and it returns a handle. The handle must be used to unregister the specifier later. -

-The following example registers a user-define specifier with the "my_namespace" namespace: -

-

-  my_handle = trio_register(my_callback, "my_namespace");
-
-

-There can only be one user-defined specifier with a given namespace. There can be an unlimited number (subject to maximum length of the namespace) of different user-defined specifiers. -

-Passing NULL as the namespace argument results in an anonymous reference. There can be an unlimited number of anonymous references. -

-REFERENCES -

-There are two ways that a registered callback can be called. Either the user-defined specifier must contain the registered namespace in the format string, or the handle is passed as an argument to the formatted printing function. -

-If the namespace is used, then a user-defined pointer must be passed as an argument: -

-

-  trio_printf("<my_namespace:format>\n", my_data);
-
-

-If the handle is used, then the user-defined specifier must not contain a namespace. Instead the handle must be passed as an argument, followed by a user-defined pointer: -

-

-  trio_printf("<format>\n", my_handle, my_data);
-
-

-The two examples above are equivalent. -

-There must be exactly one user-defined pointer per user-defined specifier. This pointer can be used within the callback function with the trio_get_argument getter function (see below). -

-The format string is optional. It can be used within the callback function with the trio_get_format getter function. -

-Anonymous References Anonymous references are specified by passing NULL as the namespace. -

-The handle must be passed as an argument followed by a user-defined pointer. No namespace can be specified. -

-

-  anon_handle = trio_register(callback, NULL);
-  trio_printf("<format>\n", anon_handle, my_data);
-
-

-Restrictions -

-

-CALLBACK FUNCTION -

-The callback function will be called if a matching user-defined specifier is found within the formatting string. The callback function takes one input parameter, an opaque reference which is needed by the private functions. It returns an int, which is currently ignored. The prototype is -

-

-  int (*trio_callback_t)(void *ref);
-
-

-See the Example section for full examples. -

-PRINTING FUNCTIONS -

-The following printing functions must only be used inside a callback function. These functions will print to the same output medium as the printf function which invoked the callback function. For example, if the user-defined specifier is used in an sprintf function, then these print functions will output their result to the same string. -

-Elementary Printing -

-There are a number of function to print elementary data types. -

-

-Formatted Printing -

-The functions trio_print_ref, trio_vprint_ref, and trio_printv_ref outputs a formatted string just like its printf equivalents. -

-

-  trio_print_ref(ref, "There are %d towels\n", 42);
-  trio_print_ref(ref, "%<recursive>\n", recursive_writer, trio_get_argument());
-
-

-GETTER AND SETTER FUNCTIONS -

-The following getter and setter functions must only be used inside a callback function. They can either operate on the modifiers or on special data. -

-Modifiers -

-The value of a modifier, or a boolean indication of its presence or absence, can be found or set with the getter and setter functions. The generic prototypes of the these getter and setter functions are -

-

-  int  trio_get_???(void *ref);
-  void trio_set_???(void *ref, int);
-
-

-where ??? refers to a modifier. For example, to get the width of the user-defined specifier use -

-

-  int width = trio_get_width(ref);
-
-

-Special Data -

-Consider the following user-defined specifier, in its two possible referencing presentations. -

-

-  trio_printf("%<format>\n", namespace_writer, argument);
-  trio_printf("%<namespace:format>\n", argument);
-
-

-trio_get_format will get the format string, and trio_get_argument} will get the argument parameter. There are no associated setter functions. -

-EXAMPLES -

-The following examples show various types of user-defined specifiers. Although each specifier is demonstrated in isolation, they can all co-exist within the same application. -

-Time Example -

-Print the time in the format "HOUR:MINUTE:SECOND" if "time" is specified inside the user-defined specifier. -

-

-  static int time_writer(void *ref)
-  {
-    const char *format;
-    time_t *data;
-    char buffer[256];
-
-    format = trio_get_format(ref);
-    if ((format) && (strcmp(format, "time") == 0)) {
-      data = trio_get_argument(ref);
-      if (data == NULL)
-        return -1;
-      strftime(buffer, sizeof(buffer), "%H:%M:%S", localtime(data));
-      trio_print_string(ref, buffer);
-    }
-    return 0;
-  }
-
-

-

-  int main(void)
-  {
-    void *handle;
-    time_t now = time(NULL);
-
-    handle = trio_register(time_print, "my_time");
-
-    trio_printf("%<time>\n", handle, &now);
-    trio_printf("%<my_time:time>\n", &now);
-
-    trio_unregister(handle);
-    return 0;
-  }
-
-

-Complex Numbers Example -

-Consider a complex number consisting of a real part, re, and an imaginary part, im. -

-

-  struct Complex {
-    double re;
-    double im;
-  };
-
-

-This example can print such a complex number in one of two formats. The default format is "re + i im". If the alternative modifier is used, then the format is "r exp(i theta)", where r is the length of the complex vector (re, im) and theta is its angle. -

-

-  static int complex_print(void *ref)
-  {
-    struct Complex *data;
-    const char *format;
-
-    data = (struct Complex *)trio_get_argument(ref);
-    if (data) {
-      format = trio_get_format(ref);
-
-      if (trio_get_alternative(ref)) {
-        double r, theta;
-
-        r = sqrt(pow(data->re, 2) + pow(data->im, 2));
-        theta = acos(data->re / r);
-        trio_print_ref(ref, "%#f exp(i %#f)", r, theta);
-
-      } else {
-        trio_print_ref(ref, "%#f + i %#f", data->re, data->im);
-      }
-    }
-    return 0;
-  }
-
-

-

-  int main(void)
-  {
-    void *handle;
-
-    handle = trio_register(complex_print, "complex");
-
-    /* Normal format. With handle and the with namespace */
-    trio_printf("%<>\n", handle, &complex);
-    trio_printf("%<complex:>\n", &complex);
-    /* In exponential notation */
-    trio_printf("%#<>\n", handle, &complex);
-    trio_printf("%#<complex:unused data>\n", &complex);
-
-    trio_unregister(handle);
-    return 0;
-  }
-
-

-RETURN VALUES -

-trio_register returns a handle, or NULL if an error occured. -

-SEE ALSO -

-trio_printf -

-NOTES -

-User-defined specifiers, trio_register, and trio_unregister are not thread-safe. In multi-threaded applications they must be guarded by mutexes. Trio provides two special callback functions, called ":enter" and ":leave", which are invoked every time a thread-unsafe operation is attempted. As the thread model is determined by the application, these callback functions must be implemented by the application. -

-The following callback functions are for demonstration-purposes only. Replace their bodies with locking and unlocking of a mutex to achieve thread-safety.

-  static int enter_region(void *ref)
-  {
-    fprintf(stderr, "Enter Region\n");
-    return 1;
-  }
-
-  static int leave_region(void *ref)
-  {
-    fprintf(stderr, "Leave Region\n");
-    return 1;
-  }
-
These two callbacks must be registered before other callbacks are registered.
-  trio_register(enter_region, ":enter");
-  trio_register(leave_region, ":leave");
-
-  another_handle = trio_register(another_callback, NULL);
-

Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - -
trio_pointer_t trio_register trio_callback_t   callback,
const char *   name
-
- - - - - -
-   - - -

-Register new user-defined specifier. -

-

-Parameters:
- - - -
callback  -
name  -
-
-Returns:
-Handle.
-

- - - - -
- - - - - - - - - - -
void trio_unregister trio_pointer_t   handle
-
- - - - - -
-   - - -

-Unregister an existing user-defined specifier. -

-

-Parameters:
- - -
handle  -
-
-


- - - diff --git a/trio/html/index.html b/trio/html/index.html deleted file mode 100644 index 124ad017..00000000 --- a/trio/html/index.html +++ /dev/null @@ -1,88 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

TRIO Documentation

-

-

-Author:
-Bjørn Reese , Daniel Stenberg

Introduction

- -

-Trio is a fully matured and stable set of printf and string functions designed be used by applications with focus on portability or with the need for additional features that are not supported by standard stdio implementation. -

-There are several cases where you may want to consider using trio: -

-

-When you write applications that must be portable to a wide range of platforms you often have to deal with inadequate implementations of the stdio library functions. Most notably is the lack of secure formatting functions, such as snprintf, or the lack of parameter reordering commonly used for the internationalization of applications, such as the <num>$ modifier. Sometimes the feature you need is simply not present in stdio. So you end up spending much effort on determining which platforms supports what, and to write your own versions of various features. This is where trio can help you. Trio is a platform-independent implementation of the stdio printf and scanf functions and the string library functions. -

-The functionality described in the stdio standards is a compromise, and does unfortunately not include a mechanism to extend the functionality for an individual application. Oftentimes an application has the need for an extra feature, and the application code can become much more clear and readable by using an extension mechanism. Trio supports a range of useful extensions such as user-defined specifiers, passing of arguments in arrays, localized string scanning, thousand-separators, and arbitrary integer bases. -

-Trio fully implements the C99 (ISO/IEC 9899:1999) and UNIX98 (the Single Unix Specification, Version 2) standards, as well as many features from other implemenations, e.g. the GNU libc and BSD4. -

-

Examples

- -

-

Binary Numbers

- Output an integer as a binary number using a trio extension.
-  trio_printf("%..2i\n", number);
-
-

-

Thousand-separator

- Output a number with thousand-separator using a trio extension.
-  trio_printf("%'f\n", 12345.6);
-
The thousand-separator described by the locale is used. -

-

Fixed Length Array and Sticky Modifier

- Output an fixed length array of floating-point numbers.
-  double array[] = {1.0, 2.0, 3.0};
-  printf("%.2f %.2f %.2f\n", array[0], array[1], array[2]);
-
The same with two trio extensions (arguments are passed in an array, and the first formatting specifier sets the sticky option so we do not have to type all the formatting modifiers for the remaining formatting specifiers)
-  trio_printfv("%!.2f %f %f\n", array);
-
Another, and more powerful, application of being able to pass arguments in an array is the creation of the printf/scanf statement at run-time, where the formatting string, and thus the argument list, is based on an external configuration file. -

-

Localized scanning

- Parse a string consisting of one or more upper-case alphabetic characters followed by one or more numeric characters.
-  sscanf(buffer, "%[A-Z]%[0-9]", alphabetic, numeric);
-
The same but with locale using a trio extension.
-  trio_sscanf(buffer, "%[[:upper:]]%[[:digit:]]", alphabetic, numeric);
-
-

-

Legal Issues

- Trio is distributed under the following license, which allows practically anybody to use it in almost any kind of software, including proprietary software, without difficulty. -

-"Copyright (C) 1998-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." -

-

Contribution

- -

-

Contribute

- We appreciate any type of contribution, from ideas over improvements to error corrections. -

-The project space contains references to bug and feature tracking, mailing-list, and the CVS repository. We prefer communication via the mailing-list, but do not require you to be subscribed, because trio is a small project. -

-The project space is located at http://sourceforge.net/projects/ctrio/ -

-

Contributors

- We have received contributions from the following persons (in alphabetic order sorted by surname) -

-

-Please let us know, and accept our apology, if we have omitted anybody. -

-


- - - diff --git a/trio/html/modules.html b/trio/html/modules.html deleted file mode 100644 index 49885970..00000000 --- a/trio/html/modules.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - TRIO - - - - -
-Main Page   Modules  
-

TRIO Modules

Here is a list of all modules: -
- - - diff --git a/trio/html/trio.css b/trio/html/trio.css deleted file mode 100644 index 1b3a9926..00000000 --- a/trio/html/trio.css +++ /dev/null @@ -1,35 +0,0 @@ -/* HTML tags */ - -BODY { - background-color: white; - color: darkblue; -} - -TD { color: darkblue; } - -H1 { text-align: center; } - -H3 { font-style: italic; } - -HR { - width: 85%; - align: center; -} - -.copyright { color: darkblue; } - -/* Links */ - -:link { color: blue; } - -:visited { color: purple; } - -:active { color: red; } - -.el:link { font-style: italic; } - -/* Examples */ - -DIV.fragment { - color: maroon; -} -- cgit v1.2.3