src/cx/buffer.h

changeset 531
1b8624c8448e
parent 530
e866516cac17
child 537
16219eba3a0a
equal deleted inserted replaced
530:e866516cac17 531:1b8624c8448e
162 * 162 *
163 * \attention 163 * \attention
164 * Security Note: The shifting operation does \em not erase the previously occupied memory cells. 164 * Security Note: The shifting operation does \em not erase the previously occupied memory cells.
165 * But you can easily do that manually, e.g. by calling 165 * But you can easily do that manually, e.g. by calling
166 * <code>memset(buffer->bytes, 0, shift)</code> for a right shift or 166 * <code>memset(buffer->bytes, 0, shift)</code> for a right shift or
167 * <code>memset(buffer->size, 0, buffer->capacity - buffer->size)</code> 167 * <code>memset(buffer->bytes + buffer->size, 0, buffer->capacity - buffer->size)</code>
168 * for a left shift. 168 * for a left shift.
169 * 169 *
170 * @param buffer the buffer 170 * @param buffer the buffer
171 * @param shift the shift offset (negative means left shift) 171 * @param shift the shift offset (negative means left shift)
172 * @return 0 on success, non-zero if a required auto-extension fails 172 * @return 0 on success, non-zero if a required auto-extension fails

mercurial