aboutsummaryrefslogtreecommitdiffstats
path: root/trio/README
blob: 55ad1b07de875513f29d806282bc18878073d44d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
README -- trio

Trio is a package with portable string functions. Including printf() clones
and others.

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

Trio is intended to be an integral part of another application, so we
have not done anything to create a proper installation.

Compile with 'make' (edit the Makefile if you want a release build)

Test the package with 'make test'

Install by copying trio.h, triop.h, and libtrio.a (and man/man?/* if
you want documentation) to the appropriate directories.

Catch some usage examples in example.c

Send feedback and patches to the mailing list, subscription and other
information is found here:

        http://lists.sourceforge.net/lists/listinfo/ctrio-talk

Enjoy!

Trio web page

        http://daniel.haxx.se/trio/
.highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
 <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
 <title>TRIO</title>
 <link href="trio.css" rel="stylesheet" type="text/css">
</head>
<body>
<!-- Generated by Doxygen 1.2.12 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; </center>
<hr><h1>Formatted Scanning Functions.</h1>Variations of formatted scanning functions. 
<a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td colspan=2><br><h2>Functions</h2></td></tr>
<tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="group___scanf.html#a0">trio_scanf</a> (const char *format,...)</td></tr>
<tr><td>&nbsp;</td><td><font size=-1><em>Scan characters from standard input stream.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Variations of formatted scanning functions.
<p>
<b>SYNOPSIS</b>
<p>
<div class="fragment"><pre>
cc ... -ltrio -lm

#include &lt;trio.h&gt;
</pre></div>
<p>
<b>DESCRIPTION</b>
<p>
This documentation is incomplete. The documentation of the scanf family in [C99] and [UNIX98] also applies to the trio counterparts.
<p>
<b>SCANNING</b>
<p>
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.
<p>
<b>Modifiers</b>
<p>
<em>Positional</em> ( <code>9$</code> ) [UNIX98]
<p>
See <a class="el" href="group___printf.html#a0">trio_printf</a>.
<p>
<b>Specifiers</b>
<p>
<em>Percent</em> ( <code>%</code> )
<p>
<em>Character</em> ( <code>c</code> )
<p>
<em>Decimal</em> ( <code>d</code> )
<p>
<em>Floating-point</em> ( <code>a</code>, <code>A</code>, <code>e</code>, <code>E</code>, <code>f</code>, <code>F</code>, <code>g</code>, <code>G</code> )
<p>
<em>Integer</em> ( <code>i</code> )
<p>
<em>Count</em> ( <code>n</code> )
<p>
<em>Octal</em> ( <code>o</code> )
<p>
<em>Pointer</em> ( <code>p</code> )
<p>
<em>String</em> ( <code>s</code> )
<p>
<em>Unsigned</em> ( <code>u</code> )
<p>
<em>Hex</em> ( <code>x</code>, <code>X</code> )
<p>
<em>Scanlist</em> ( <code>[]</code> )
<p>
Scanlist Exclusion (<code>^</code> )
<p>
Scanlist Range ( <code>-</code> ) [TRIO]
<p>
<ul>
<li> Only increasing ranges, i.e. <code>[a-b]</code>, but not <code>[b-a]</code>. <li> Transitive ranges, ie. <code>[a-b-c]</code> equals <code>[a-c]</code>. <li> Trailing minus, ie. <code>[a-]</code> is interpreted as an <code>a</code> and a <code>-</code>. <li> Duplicates are ignored.</ul>
Scanlist Equivalence Class Expression ( <code>[</code>= =<code>]</code> ) [TRIO]
<p>
Locale dependent (LC_COLLATE). Only one expression can appear inside the delimiters. <ul>
<li> <code>[=a=]</code> All letters in the same equivalence class as the letter <code>a</code>. <div class="fragment"><pre>
  trio_scanf("%[[=a=]b]\n", buffer);
  trio_scanf("%[[=a=][=b=]]\n", buffer);
</pre></div></ul>
Scanlist Character Class Expression ( <code>[</code>: :<code>])</code> [TRIO] Locale dependent (LC_CTYPE). Only one expression can appear inside the delimiters. <ul>
<li> <code>[:alnum:]</code> Same as <code>[:alpha:]</code> and <code>[:digit:]</code> <li> <code>[:alpha:]</code> Same as <code>[:lower:]</code> and <code>[:upper:]</code> <li> <code>[:cntrl:]</code> Control characters <li> <code>[:digit:]</code> Decimal digits <li> <code>[:graph:]</code> Printable characters except space <li> <code>[:lower:]</code> Lower case alphabetic letters <li> <code>[:print:]</code> Printable characters <li> <code>[:punct:]</code> Punctuation <li> <code>[:space:]</code> Whitespace characters <li> <code>[:upper:]</code> Upper case alphabetic letters <li> <code>[:xdigit:]</code> Hexadecimal digits <div class="fragment"><pre>
  trio_scanf("%[[:alnum:]]\n", buffer);
  trio_scanf("%[[:alpha:][:digit:]]\n", buffer);
</pre></div></ul>
<b>RETURN</b> <b>VALUES</b>
<p>
<b>SEE</b> <b>ALSO</b>
<p>
<a class="el" href="group___printf.html#a0">trio_printf</a> <hr><h2>Function Documentation</h2>
<a name="a0" doxytag="trio.c::trio_scanf"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
  <tr>
    <td class="md">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> int trio_scanf </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const char *&nbsp;</td>
          <td class="mdname" nowrap>&nbsp; <em>format</em>, </td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td class="md" nowrap>...&nbsp;</td>
          <td class="mdname" nowrap>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Scan characters from standard input stream.
<p>
<dl compact><dt><b>
Parameters: </b><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>format</em>&nbsp;</td><td>
Formatting string. </td></tr>
<tr><td valign=top><em>...</em>&nbsp;</td><td>
Arguments. </td></tr>
</table>
</dl><dl compact><dt><b>
Returns: </b><dd>
Number of scanned characters. </dl>    </td>
  </tr>
</table>
<HR>
<center class="copyright">Copyright (C) 2001 Bj&oslash;rn Reese and Daniel Stenberg.</center>
</body>
</html>