| 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> |
| 3 |
<title>PEAK Library: Line-mode operations</title> |
| 4 |
<link href="doxygen.css" rel="stylesheet" type="text/css"> |
| 5 |
</head><body> |
| 6 |
<!-- Generated by Doxygen 1.3.5 --> |
| 7 |
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="functions.html">Data Fields</a></div> |
| 8 |
<h1>Line-mode operations<br> |
| 9 |
<small> |
| 10 |
[<a class="el" href="group__stream.html">Socket streams</a>]</small> |
| 11 |
</h1><hr><a name="_details"></a><h2>Detailed Description</h2> |
| 12 |
Line-mode based stream methods. |
| 13 |
<p> |
| 14 |
|
| 15 |
<p> |
| 16 |
<table border=0 cellpadding=0 cellspacing=0> |
| 17 |
<tr><td></td></tr> |
| 18 |
<tr><td colspan=2><br><h2>Defines</h2></td></tr> |
| 19 |
<tr><td class="memItemLeft" nowrap align=right valign=top>#define </td><td class="memItemRight" valign=bottom><a class="el" href="group__stream__line.html#ga3">LINEMODE_BUFFER_SIZE</a> 1024</td></tr> |
| 20 |
|
| 21 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Internal library buffer size for line mode. <a href="#ga3"></a><br><br></td></tr> |
| 22 |
<tr><td colspan=2><br><h2>Functions</h2></td></tr> |
| 23 |
<tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="group__stream__line.html#ga0">peak_stream_is_linemode_enabled</a> (<a class="el" href="group__stream.html#ga0">peak_stream</a> s)</td></tr> |
| 24 |
|
| 25 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Test if the stream is currently in line mode. <a href="#ga0"></a><br><br></td></tr> |
| 26 |
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="group__stream__line.html#ga1">peak_stream_set_linemode</a> (<a class="el" href="group__stream.html#ga0">peak_stream</a> s)</td></tr> |
| 27 |
|
| 28 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Set line mode dynamically. <a href="#ga1"></a><br><br></td></tr> |
| 29 |
<tr><td class="memItemLeft" nowrap align=right valign=top>char * </td><td class="memItemRight" valign=bottom><a class="el" href="group__stream__line.html#ga2">peak_stream_get_line</a> (<a class="el" href="group__stream.html#ga0">peak_stream</a> s)</td></tr> |
| 30 |
|
| 31 |
<tr><td class="mdescLeft"> </td><td class="mdescRight">Get a pointer to the next line read on a stream. <a href="#ga2"></a><br><br></td></tr> |
| 32 |
</table> |
| 33 |
<hr><h2>Define Documentation</h2> |
| 34 |
<a class="anchor" name="ga3" doxytag="stream.h::LINEMODE_BUFFER_SIZE" ></a><p> |
| 35 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| 36 |
<tr> |
| 37 |
<td class="mdRow"> |
| 38 |
<table cellpadding="0" cellspacing="0" border="0"> |
| 39 |
<tr> |
| 40 |
<td class="md" nowrap valign="top"> #define LINEMODE_BUFFER_SIZE 1024 |
| 41 |
</table> |
| 42 |
</td> |
| 43 |
</tr> |
| 44 |
</table> |
| 45 |
<table cellspacing=5 cellpadding=0 border=0> |
| 46 |
<tr> |
| 47 |
<td> |
| 48 |
|
| 49 |
</td> |
| 50 |
<td> |
| 51 |
|
| 52 |
<p> |
| 53 |
Internal library buffer size for line mode. |
| 54 |
<p> |
| 55 |
The length of the line obtained via <a class="el" href="group__stream__line.html#ga44">peak_stream_get_line()</a> cannot be highter than that. </td> |
| 56 |
</tr> |
| 57 |
</table> |
| 58 |
<hr><h2>Function Documentation</h2> |
| 59 |
<a class="anchor" name="ga2" doxytag="stream.h::peak_stream_get_line" ></a><p> |
| 60 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| 61 |
<tr> |
| 62 |
<td class="mdRow"> |
| 63 |
<table cellpadding="0" cellspacing="0" border="0"> |
| 64 |
<tr> |
| 65 |
<td class="md" nowrap valign="top"> char* peak_stream_get_line </td> |
| 66 |
<td class="md" valign="top">( </td> |
| 67 |
<td class="md" nowrap valign="top"><a class="el" href="group__stream.html#ga0">peak_stream</a> </td> |
| 68 |
<td class="mdname1" valign="top" nowrap> <em>s</em> </td> |
| 69 |
<td class="md" valign="top"> ) </td> |
| 70 |
<td class="md" nowrap></td> |
| 71 |
</tr> |
| 72 |
|
| 73 |
</table> |
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
</table> |
| 77 |
<table cellspacing=5 cellpadding=0 border=0> |
| 78 |
<tr> |
| 79 |
<td> |
| 80 |
|
| 81 |
</td> |
| 82 |
<td> |
| 83 |
|
| 84 |
<p> |
| 85 |
Get a pointer to the next line read on a stream. |
| 86 |
<p> |
| 87 |
This function loan you a pointer to a mutable buffer. You are allowed to modify it (at least the bytes until the 0 sentinel character). It's useful and efficient for inline tokenizers. Please note this buffer is only valid until the next stream operation.<p> |
| 88 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
| 89 |
<table border="0" cellspacing="2" cellpadding="0"> |
| 90 |
<tr><td valign=top><em>s</em> </td><td>The stream reference.</td></tr> |
| 91 |
</table> |
| 92 |
</dl> |
| 93 |
<dl compact><dt><b>Returns:</b></dt><dd>A pointer to the line read (mutable buffer). </dd></dl> |
| 94 |
</td> |
| 95 |
</tr> |
| 96 |
</table> |
| 97 |
<a class="anchor" name="ga0" doxytag="stream.h::peak_stream_is_linemode_enabled" ></a><p> |
| 98 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| 99 |
<tr> |
| 100 |
<td class="mdRow"> |
| 101 |
<table cellpadding="0" cellspacing="0" border="0"> |
| 102 |
<tr> |
| 103 |
<td class="md" nowrap valign="top"> int peak_stream_is_linemode_enabled </td> |
| 104 |
<td class="md" valign="top">( </td> |
| 105 |
<td class="md" nowrap valign="top"><a class="el" href="group__stream.html#ga0">peak_stream</a> </td> |
| 106 |
<td class="mdname1" valign="top" nowrap> <em>s</em> </td> |
| 107 |
<td class="md" valign="top"> ) </td> |
| 108 |
<td class="md" nowrap></td> |
| 109 |
</tr> |
| 110 |
|
| 111 |
</table> |
| 112 |
</td> |
| 113 |
</tr> |
| 114 |
</table> |
| 115 |
<table cellspacing=5 cellpadding=0 border=0> |
| 116 |
<tr> |
| 117 |
<td> |
| 118 |
|
| 119 |
</td> |
| 120 |
<td> |
| 121 |
|
| 122 |
<p> |
| 123 |
Test if the stream is currently in line mode. |
| 124 |
<p> |
| 125 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
| 126 |
<table border="0" cellspacing="2" cellpadding="0"> |
| 127 |
<tr><td valign=top><em>s</em> </td><td>The stream reference.</td></tr> |
| 128 |
</table> |
| 129 |
</dl> |
| 130 |
<dl compact><dt><b>Return values:</b></dt><dd> |
| 131 |
<table border="0" cellspacing="2" cellpadding="0"> |
| 132 |
<tr><td valign=top><em>0</em> </td><td>if linemode is disabled. </td></tr> |
| 133 |
<tr><td valign=top><em>1</em> </td><td>if linemode is enabled: you can use <a class="el" href="group__stream__line.html#ga44">peak_stream_get_line()</a>. </td></tr> |
| 134 |
</table> |
| 135 |
</dl> |
| 136 |
</td> |
| 137 |
</tr> |
| 138 |
</table> |
| 139 |
<a class="anchor" name="ga1" doxytag="stream.h::peak_stream_set_linemode" ></a><p> |
| 140 |
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> |
| 141 |
<tr> |
| 142 |
<td class="mdRow"> |
| 143 |
<table cellpadding="0" cellspacing="0" border="0"> |
| 144 |
<tr> |
| 145 |
<td class="md" nowrap valign="top"> void peak_stream_set_linemode </td> |
| 146 |
<td class="md" valign="top">( </td> |
| 147 |
<td class="md" nowrap valign="top"><a class="el" href="group__stream.html#ga0">peak_stream</a> </td> |
| 148 |
<td class="mdname1" valign="top" nowrap> <em>s</em> </td> |
| 149 |
<td class="md" valign="top"> ) </td> |
| 150 |
<td class="md" nowrap></td> |
| 151 |
</tr> |
| 152 |
|
| 153 |
</table> |
| 154 |
</td> |
| 155 |
</tr> |
| 156 |
</table> |
| 157 |
<table cellspacing=5 cellpadding=0 border=0> |
| 158 |
<tr> |
| 159 |
<td> |
| 160 |
|
| 161 |
</td> |
| 162 |
<td> |
| 163 |
|
| 164 |
<p> |
| 165 |
Set line mode dynamically. |
| 166 |
<p> |
| 167 |
Note that you cannot disable linemode with the current implementation.<p> |
| 168 |
<dl compact><dt><b>Parameters:</b></dt><dd> |
| 169 |
<table border="0" cellspacing="2" cellpadding="0"> |
| 170 |
<tr><td valign=top><em>s</em> </td><td>The stream reference. </td></tr> |
| 171 |
</table> |
| 172 |
</dl> |
| 173 |
</td> |
| 174 |
</tr> |
| 175 |
</table> |
| 176 |
<hr size="1"><address style="align: right;"><small>Generated on Sat Jan 17 21:41:54 2004 for the PEAK Library by |
| 177 |
<a href="http://www.doxygen.org/index.html"> |
| 178 |
<img src="doxygen.png" alt="doxygen" align="middle" border="0" > |
| 179 |
</a></small> <a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=98146&type=1" width="88" height="31" align="middle" border="0" alt="SourceForge.net Logo" /></a></address> |
| 180 |
</body> |
| 181 |
</html> |
| 182 |
|