From 1c9877327ead37b7dd5a0ca3a8c7912e924328e5 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 4 Dec 2014 14:16:47 -0800 Subject: glsl: Add blob.c---a simple interface for serializing data This new interface allows for writing a series of objects to a chunk of memory (a "blob").. The allocated memory is maintained within the blob itself, (and re-allocated by doubling when necessary). There are also functions for reading objects from a blob as well. If code attempts to read beyond the available memory, the read functions return 0 values (or its moral equivalent) without reading past the allocated memory. Once the caller is done with the reads, it can check blob->overrun to ensure whether any invalid values were previously returned due to attempts to read too far. Reviewed-by: Jason Ekstrand --- src/glsl/Makefile.sources | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/glsl/Makefile.sources') diff --git a/src/glsl/Makefile.sources b/src/glsl/Makefile.sources index a951ca7dbc6..6237627ac60 100644 --- a/src/glsl/Makefile.sources +++ b/src/glsl/Makefile.sources @@ -65,6 +65,8 @@ LIBGLSL_FILES = \ $(GLSL_SRCDIR)/ast_function.cpp \ $(GLSL_SRCDIR)/ast_to_hir.cpp \ $(GLSL_SRCDIR)/ast_type.cpp \ + $(GLSL_SRCDIR)/blob.c \ + $(GLSL_SRCDIR)/blob.h \ $(GLSL_SRCDIR)/builtin_functions.cpp \ $(GLSL_SRCDIR)/builtin_type_macros.h \ $(GLSL_SRCDIR)/builtin_types.cpp \ -- cgit v1.2.3