X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FModules%2FInterfaces%2FUDI%2Fudi_lib%2Fcore%2Fbuf.c;h=a9df466bc5fa7fc9b25bb5710c25fe939d50d19b;hb=6c17bdc4f8dee5d2a9c97f1db2cd9b85eefa9b8e;hp=5327cc8b957b6dcd85d9d54a855e95353e3b365b;hpb=fb13a50bc14688a20dc37acbbbbe23f56bf63c41;p=tpg%2Facess2.git diff --git a/KernelLand/Modules/Interfaces/UDI/udi_lib/core/buf.c b/KernelLand/Modules/Interfaces/UDI/udi_lib/core/buf.c index 5327cc8b..a9df466b 100644 --- a/KernelLand/Modules/Interfaces/UDI/udi_lib/core/buf.c +++ b/KernelLand/Modules/Interfaces/UDI/udi_lib/core/buf.c @@ -6,6 +6,30 @@ */ #include #include +#include + +typedef struct sUDI_BufTag +{ + struct sUDI_BufTag *Next; +// udi_buf_tag_t tag; + struct sUDI_BufSect *Sect; +} tUDI_BufTag; + +typedef struct sUDI_BufSect +{ + struct sUDI_BufSect *Next; + size_t Offset; + size_t Length; + size_t Space; + // data +} tUDI_BufSect; + +typedef struct +{ + udi_buf_t buf; + tUDI_BufTag *Tags; + tUDI_BufSect *Sections; +} tUDI_BufInt; // === EXPORTS === EXPORT(udi_buf_copy); @@ -37,8 +61,7 @@ void udi_buf_copy( * \param src_len Length of source data * \param dst_buf Destination buffer * \param dst_off Destination offset in the buffer - * \param dst_len Length of destination area (What the?, Redundant - * Department of redundacny department) + * \param dst_len Length of destination area * \param path_handle ??? */ void udi_buf_write( @@ -52,7 +75,38 @@ void udi_buf_write( udi_buf_path_t path_handle ) { - UNIMPLEMENTED(); + tUDI_BufInt *dst = (void*)dst_buf; + if( !dst ) { + dst = NEW(tUDI_BufInt,); + } + + if( dst_len == 0 ) + { + // Insert / Initialise + if( src_len > 0 ) + { + Log_Warning("UDI", "TODO: udi_buf_write - insert"); + } + // no-op + else + { + } + } + else + { + // Overwrite + if( src_len > 0 ) + { + Log_Warning("UDI", "TODO: udi_buf_write - overwrite"); + } + // Delete + else + { + Log_Warning("UDI", "TODO: udi_buf_write - delete"); + } + } + + callback(gcb, &dst->buf); } void udi_buf_read(