Choco OS  V.0.16.9.0
Join to the chocolate world
oc_stream.h
Go to the documentation of this file.
1 
28 #ifndef INC_KERNEL_OC_STREAM_H_
29 #define INC_KERNEL_OC_STREAM_H_
30 
31 #include <stdbool.h>
32 #include <oc_errors.h>
33 #include <oc_driver.h>
34 #include <oc_stdlib.h>
35 
41 #define _________________________________________TYPES_SECTION______________________________________________________________________________
42 
45 typedef enum
46 {
47  oC_Stream_Type_Input = (1<<0),
48  oC_Stream_Type_Output = (1<<1)
49 } oC_Stream_Type_t;
50 
51 typedef struct Stream_t * oC_Stream_t;
52 
53 typedef struct
54 {
55  oC_Stream_Type_t Type;
56  const char * Name;
57  oC_Driver_t Driver;
58  const void * Config;
60 
61 #undef _________________________________________TYPES_SECTION______________________________________________________________________________
62 
69 #define _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
70 
73 extern oC_Stream_t oC_Stream_New ( Allocator_t Allocator , AllocationFlags_t Flags , oC_Stream_Type_t Type , const char * Name , oC_Driver_t Driver , const void * Config );
74 extern bool oC_Stream_Delete ( oC_Stream_t * Stream );
75 extern bool oC_Stream_IsCorrect ( oC_Stream_t Stream );
76 extern bool oC_Stream_IsType ( oC_Stream_t Stream , oC_Stream_Type_t Type );
77 extern oC_ErrorCode_t oC_Stream_Write ( oC_Stream_t Stream , const char * Buffer , uint32_t * Size , oC_IoFlags_t IoFlags );
78 extern oC_ErrorCode_t oC_Stream_Read ( oC_Stream_t Stream , char * outBuffer , uint32_t * Size , oC_IoFlags_t IoFlags );
79 extern oC_ErrorCode_t oC_Stream_ClearReadBuffer ( oC_Stream_t Stream );
80 extern const char * oC_Stream_GetName ( oC_Stream_t Stream );
81 extern oC_Driver_t oC_Stream_GetDriver ( oC_Stream_t Stream );
82 
83 #undef _________________________________________FUNCTIONS_SECTION__________________________________________________________________________
84 
86 #endif /* INC_KERNEL_OC_STREAM_H_ */
identifier for allocations
Definition: oc_stdlib.h:159
The file with interface for driver creating.
static const oC_Allocator_t Allocator
Definition: oc_eth.c:152