MOD_IOLAYER_BUFFERED
[MOD_IOLAYER]

Informational Functions



GWENHYWFAR_API uint32_t GWEN_Io_LayerBuffered_GetReadLineCount (const GWEN_IO_LAYER *io)
GWENHYWFAR_API uint32_t GWEN_Io_LayerBuffered_GetReadLinePos (const GWEN_IO_LAYER *io)
GWENHYWFAR_API void GWEN_Io_LayerBuffered_ResetLinePosAndCounter (GWEN_IO_LAYER *io)

Constructor



GWENHYWFAR_API GWEN_IO_LAYERGWEN_Io_LayerBuffered_new (GWEN_IO_LAYER *baseLayer)

Convenience Functions



GWENHYWFAR_API int GWEN_Io_LayerBuffered_ReadLineToBuffer (GWEN_IO_LAYER *io, GWEN_BUFFER *fbuf, uint32_t guiid, int msecs)
GWENHYWFAR_API int GWEN_Io_LayerBuffered_WriteLine (GWEN_IO_LAYER *io, const char *buffer, int len, int flush, uint32_t guiid, int msecs)

Flags For This Module

You can set these flags using GWEN_Io_Layer_SetFlags() or GWEN_Io_Layer_AddFlags().



#define GWEN_IO_LAYER_BUFFERED_FLAGS_DOSMODE   0x00000001

Makro Defining the Type Name



#define GWEN_IO_LAYER_BUFFERED_TYPE   "buffered"

Request Flags For This Module

You can set these flags on IO requests using GWEN_Io_Request_SetFlags() or GWEN_Io_Request_AddFlags().



#define GWEN_IO_REQUEST_BUFFERED_FLAGS_PEEK   0x00000002
#define GWEN_IO_REQUEST_BUFFERED_FLAGS_RAW   0x00000001
#define GWEN_IO_REQUEST_BUFFERED_FLAGS_UNTILEMPTYLINE   0x00000004

Detailed Description

This module provides access to already open files. It supports the following request types:


Define Documentation

#define GWEN_IO_LAYER_BUFFERED_FLAGS_DOSMODE   0x00000001

If this flag is set then lines are expected to end with CR/LF as opposed to Linux mode where a simple LF suffices to mark the end of a line.

Definition at line 57 of file io_buffered.h.

Referenced by GWEN_HttpSession_Init(), and GWEN_Io_LayerBuffered_WorkOnWriteRequest().

#define GWEN_IO_LAYER_BUFFERED_TYPE   "buffered"

Definition at line 43 of file io_buffered.h.

Referenced by GWEN_Io_LayerBuffered_new().

#define GWEN_IO_REQUEST_BUFFERED_FLAGS_PEEK   0x00000002

If this flag is set then the internal read pointer will not be advanced. This can be used to peek for available data without actually removing it from the internal buffer. Subsequent read requests with this flag set will return the same data.

Definition at line 78 of file io_buffered.h.

Referenced by GWEN_Io_LayerBuffered_WorkOnReadRequest().

#define GWEN_IO_REQUEST_BUFFERED_FLAGS_RAW   0x00000001

If this flag is set then raw data is to be transfered so the data will not be modified by this io layer (e.g. no CR/LF will be appended or removed).

Definition at line 71 of file io_buffered.h.

Referenced by GWEN_Io_LayerBuffered_AddRequest(), GWEN_Io_LayerBuffered_WorkOnReadRequest(), GWEN_Io_LayerHttp_WorkOnReadRequest2(), GWEN_Io_LayerHttp_WorkOnWriteRequest1(), and GWEN_Io_LayerHttp_WorkOnWriteRequest2().

#define GWEN_IO_REQUEST_BUFFERED_FLAGS_UNTILEMPTYLINE   0x00000004

Definition at line 80 of file io_buffered.h.

Referenced by GWEN_Io_LayerBuffered_WorkOnReadRequest().


Function Documentation

GWENHYWFAR_API uint32_t GWEN_Io_LayerBuffered_GetReadLineCount ( const GWEN_IO_LAYER io  ) 

Definition at line 898 of file io_buffered.c.

References GWEN_INHERIT_GETDATA.

GWENHYWFAR_API uint32_t GWEN_Io_LayerBuffered_GetReadLinePos ( const GWEN_IO_LAYER io  ) 

Definition at line 910 of file io_buffered.c.

References GWEN_INHERIT_GETDATA.

GWENHYWFAR_API GWEN_IO_LAYER* GWEN_Io_LayerBuffered_new ( GWEN_IO_LAYER baseLayer  ) 
GWENHYWFAR_API int GWEN_Io_LayerBuffered_ReadLineToBuffer ( GWEN_IO_LAYER io,
GWEN_BUFFER fbuf,
uint32_t  guiid,
int  msecs 
)

This function reads bytes from the base layer until a Line Feed character (#10) is found. It then returns these bytes (excluding the #10) in the given buffer. Carriage Return characters (#13) are ignored in any case.

Definition at line 816 of file io_buffered.c.

References DBG_INFO, GWEN_Buffer_AppendBytes(), GWEN_ERROR_EOF, GWEN_ERROR_INTERNAL, GWEN_Io_Layer_AddRequest(), GWEN_Io_Manager_WaitForRequest(), GWEN_IO_REQUEST_FLAGS_PACKETEND, GWEN_Io_Request_free(), GWEN_Io_Request_GetBufferPos(), GWEN_Io_Request_GetFlags(), GWEN_Io_Request_GetResultCode(), GWEN_Io_Request_GetStatus(), GWEN_Io_Request_new(), GWEN_Io_Request_StatusFinished, GWEN_Io_Request_TypeRead, GWEN_LOGDOMAIN, and NULL.

GWENHYWFAR_API void GWEN_Io_LayerBuffered_ResetLinePosAndCounter ( GWEN_IO_LAYER io  ) 

Definition at line 922 of file io_buffered.c.

References GWEN_INHERIT_GETDATA.

GWENHYWFAR_API int GWEN_Io_LayerBuffered_WriteLine ( GWEN_IO_LAYER io,
const char *  buffer,
int  len,
int  flush,
uint32_t  guiid,
int  msecs 
)

This function writes a line of text to the base layer and adds a CR/LF sequence when in DOS mode or a LF character in non-DOS mode.

Definition at line 877 of file io_buffered.c.

References DBG_INFO, GWEN_Io_Layer_WriteBytes(), GWEN_IO_REQUEST_FLAGS_FLUSH, GWEN_IO_REQUEST_FLAGS_PACKETEND, GWEN_IO_REQUEST_FLAGS_WRITEALL, and GWEN_LOGDOMAIN.


Generated on Sat Jan 2 09:32:39 2010 for gwenhywfar by  doxygen 1.6.1