Home | History | Annotate | Download | only in glsl

Lines Matching refs:blob

36 /* The blob functions implement a simple, low-level API for serializing and
39 * All objects written to a blob will be serialized directly, (without any
42 * by knowing exactly what data is expected, or by writing to the blob
45 * A blob is efficient in that it dynamically grows by doubling in size, so
49 struct blob {
50 /* The data actually written to the blob. */
63 * 1. blob->current should be equal to blob->end, (if not, too little was
66 * 2. blob->overrun should be false, (otherwise, too much was read).
76 * Create a new, empty blob, belonging to \mem_ctx.
78 * \return The new blob, (or NULL in case of allocation failure).
80 struct blob *
84 * Add some unstructured, fixed-size data to a blob.
89 blob_write_bytes (struct blob *blob, const void *bytes, size_t to_write);
92 * Reserve space in \blob for a number of bytes.
94 * Space will be allocated within the blob for these byes, but the bytes will
99 * invalidated by any other call to a blob function. So the caller should call
103 * that is not aware of the blob API, (so that blob_write_bytes cannot be
106 * \return A pointer to space allocated within \blob to which \to_write bytes
110 blob_reserve_bytes (struct blob *blob, size_t to_write);
113 * Overwrite some data previously written to the blob.
115 * Writes data to an existing portion of the blob at an offset of \offset.
116 * This data range must have previously been written to the blob by one of the
122 * the current blob's size.
125 blob_overwrite_bytes (struct blob *blob,
131 * Add a uint32_t to a blob.
134 * beginning of the blob's data, so some padding bytes may be added to the
135 * blob if this write follows some unaligned write (such as
141 blob_write_uint32 (struct blob *blob, uint32_t value);
144 * Overwrite a uint32_t previously written to the blob.
146 * Writes a uint32_t value to an existing portion of the blob at an offset of
147 * \offset. This data range must have previously been written to the blob by
155 * offset = blob->size;
156 * blob_write_uint32 (blob, 0); // placeholder
157 * ... various blob write calls, writing N items ...
158 * blob_overwrite_uint32 (blob, offset, N);
161 * the current blob's size.
164 blob_overwrite_uint32 (struct blob *blob,
169 * Add a uint64_t to a blob.
172 * beginning of the blob's data, so some padding bytes may be added to the
173 * blob if this write follows some unaligned write (such as
179 blob_write_uint64 (struct blob *blob, uint64_t value);
182 * Add an intptr_t to a blob.
185 * beginning of the blob's data, so some padding bytes may be added to the
186 * blob if this write follows some unaligned write (such as
192 blob_write_intptr (struct blob *blob, intptr_t value);
195 * Add a NULL-terminated string to a blob, (including the NULL terminator).
200 blob_write_string (struct blob *blob, const char *str);
203 * Start reading a blob, (initializing the contents of \blob for reading).
214 blob_reader_init (struct blob_reader *blob, uint8_t *data, size_t size);
220 * \note The memory returned belongs to the data underlying the blob reader. The
222 * underlying the blob reader.
227 blob_read_bytes (struct blob_reader *blob, size_t size);
234 blob_copy_bytes (struct blob_reader *blob, uint8_t *dest, size_t size);
241 * beginning of the blob's data, so some padding bytes may be skipped.
246 blob_read_uint32 (struct blob_reader *blob);
253 * beginning of the blob's data, so some padding bytes may be skipped.
258 blob_read_uint64 (struct blob_reader *blob);
265 * beginning of the blob's data, so some padding bytes may be skipped.
270 blob_read_intptr (struct blob_reader *blob);
276 * \note The memory returned belongs to the data underlying the blob reader. The
278 * of the data underlying the blob reader.
281 * there is no NULL byte remaining within the blob, this function returns
285 blob_read_string (struct blob_reader *blob);