Constructors | |
| GWENHYWFAR_API GWEN_IO_LAYER * | GWEN_Io_LayerMemory_fromString (const uint8_t *p, int size) |
| GWENHYWFAR_API GWEN_IO_LAYER * | GWEN_Io_LayerMemory_new (GWEN_BUFFER *buffer) |
Informational Functions | |
| GWENHYWFAR_API GWEN_BUFFER * | GWEN_Io_LayerMemory_GetBuffer (const GWEN_IO_LAYER *io) |
Makro Defining the Type Name | |
| #define | GWEN_IO_LAYER_MEMORY_TYPE "memory" |
An io layer of this module is an endpoint since it has no base layer.
This io layer always handles request directly upon GWEN_Io_Layer_AddRequest() so when that function returns the given request is already finished.
| #define GWEN_IO_LAYER_MEMORY_TYPE "memory" |
| GWENHYWFAR_API GWEN_IO_LAYER* GWEN_Io_LayerMemory_fromString | ( | const uint8_t * | p, | |
| int | size | |||
| ) |
Creates a new IO layer using the given data. This function internally creates a GWEN_BUFFER and calls GWEN_Io_LayerMemory_new() with it. After that it sets the flag GWEN_IO_LAYER_MEMORY_FLAGS_TAKEOVER to make the new io layer take over the just created buffer. Such an io layer can immediately by used to read data from.
| p | pointer to the string from which the internal buffer is to filled. | |
| size | size of the string pointed to by p (use -1 to make this function calculate the size using strlen) |
Definition at line 64 of file io_memory.c.
References GWEN_Buffer_AppendBytes(), GWEN_Buffer_new(), GWEN_Buffer_Rewind(), GWEN_Io_Layer_AddFlags(), GWEN_IO_LAYER_FLAGS_TAKEOVER, and GWEN_Io_LayerMemory_new().
Referenced by GWEN_DB_ReadFromString(), and GWEN_XMLNode_fromString().
| GWENHYWFAR_API GWEN_BUFFER* GWEN_Io_LayerMemory_GetBuffer | ( | const GWEN_IO_LAYER * | io | ) |
Return a pointer to the internally used GWEN_BUFFER. Please note that if the flag GWEN_IO_LAYER_MEMORY_FLAGS_TAKEOVER is set when this io layer is free'd the GWEN_BUFFER will also be free'd!
Definition at line 102 of file io_memory.c.
References GWEN_INHERIT_GETDATA.
| GWENHYWFAR_API GWEN_IO_LAYER* GWEN_Io_LayerMemory_new | ( | GWEN_BUFFER * | buffer | ) |
Creates a new IO layer using the given buffer.
| buffer | GWEN_BUFFER to be used |
Definition at line 40 of file io_memory.c.
References GWEN_INHERIT_SETDATA, GWEN_IO_LAYER_MEMORY_TYPE, GWEN_Io_Layer_new(), GWEN_Io_Layer_SetAddRequestFn(), GWEN_Io_Layer_SetDelRequestFn(), GWEN_Io_Layer_SetHasWaitingRequestsFn(), GWEN_Io_Layer_SetStatus(), GWEN_Io_Layer_SetWorkOnRequestsFn(), GWEN_Io_Layer_StatusConnected, GWEN_Io_LayerMemory_AddRequest(), GWEN_Io_LayerMemory_DelRequest(), GWEN_Io_LayerMemory_freeData(), GWEN_Io_LayerMemory_HasWaitingRequests(), GWEN_Io_LayerMemory_WorkOnRequests(), GWEN_NEW_OBJECT, and NULL.
Referenced by GWEN_DB_WriteToBuffer(), GWEN_DBIO_ExportToBuffer(), GWEN_Io_LayerMemory_fromString(), and GWEN_XMLNode_toBuffer().
1.5.6