1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2015 Olaf Wintermann. All rights reserved. |
4 * Copyright 2016 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
195 * @return 0 on success or a non-zero value on failure |
195 * @return 0 on success or a non-zero value on failure |
196 */ |
196 */ |
197 int ucx_buffer_extend(UcxBuffer *buffer, size_t additional_bytes); |
197 int ucx_buffer_extend(UcxBuffer *buffer, size_t additional_bytes); |
198 |
198 |
199 /** |
199 /** |
200 * Writes data to an UcxBuffer. |
200 * Writes data to a UcxBuffer. |
201 * |
201 * |
202 * The position of the buffer is increased by the number of bytes written. |
202 * The position of the buffer is increased by the number of bytes written. |
203 * |
203 * |
204 * @param ptr a pointer to the memory area containing the bytes to be written |
204 * @param ptr a pointer to the memory area containing the bytes to be written |
205 * @param size the length of one element |
205 * @param size the length of one element |
209 */ |
209 */ |
210 size_t ucx_buffer_write(const void *ptr, size_t size, size_t nitems, |
210 size_t ucx_buffer_write(const void *ptr, size_t size, size_t nitems, |
211 UcxBuffer *buffer); |
211 UcxBuffer *buffer); |
212 |
212 |
213 /** |
213 /** |
214 * Reads data from an UcxBuffer. |
214 * Reads data from a UcxBuffer. |
215 * |
215 * |
216 * The position of the buffer is increased by the number of bytes read. |
216 * The position of the buffer is increased by the number of bytes read. |
217 * |
217 * |
218 * @param ptr a pointer to the memory area where to store the read data |
218 * @param ptr a pointer to the memory area where to store the read data |
219 * @param size the length of one element |
219 * @param size the length of one element |