Main Page | Modules | Data Structures | Data Fields

Line-mode operations
[Socket streams]


Detailed Description

Line-mode based stream methods.


Defines

#define LINEMODE_BUFFER_SIZE   1024
 Internal library buffer size for line mode.


Functions

int peak_stream_is_linemode_enabled (peak_stream s)
 Test if the stream is currently in line mode.

void peak_stream_set_linemode (peak_stream s)
 Set line mode dynamically.

char * peak_stream_get_line (peak_stream s)
 Get a pointer to the next line read on a stream.


Define Documentation

#define LINEMODE_BUFFER_SIZE   1024
 

Internal library buffer size for line mode.

The length of the line obtained via peak_stream_get_line() cannot be highter than that.


Function Documentation

char* peak_stream_get_line peak_stream  s  ) 
 

Get a pointer to the next line read on a stream.

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.

Parameters:
s The stream reference.
Returns:
A pointer to the line read (mutable buffer).

int peak_stream_is_linemode_enabled peak_stream  s  ) 
 

Test if the stream is currently in line mode.

Parameters:
s The stream reference.
Return values:
0 if linemode is disabled.
1 if linemode is enabled: you can use peak_stream_get_line().

void peak_stream_set_linemode peak_stream  s  ) 
 

Set line mode dynamically.

Note that you cannot disable linemode with the current implementation.

Parameters:
s The stream reference.


Generated on Thu Jan 8 18:16:24 2004 for the PEAK Library by doxygen     SourceForge.net Logo