* @brief Push a copy of @p item onto the back of the queue. * * Copies exactly `queue_item_size(q)` bytes from @p item into the * queue. The caller's buffer can be reused or freed afterwards — the * queue owns the copy. * * @param q Destination queue. * @param item Pointer to the value to copy. Must NOT be NULL. * * @return true on success, false on NULL inputs or underlying vector *
| 285 | * @param q Queue pointer. NULL returns 0. |
| 286 | * @return Capacity in elements. |
| 287 | */ |
| 288 | size_t queue_capacity(const Queue* q) { |
| 289 | QUEUE_LOG("[queue_capacity]: enter q=%p", (const void*)q); |
| 290 | |
| 291 | if (!q || !q->vec) { |
| 292 | QUEUE_LOG("[queue_capacity]: NULL receiver -> 0"); |
| 293 | return 0; |
| 294 | } |
| 295 | size_t out = vector_capacity((Vector*)q->vec); |
| 296 | QUEUE_LOG("[queue_capacity]: exit -> %zu", out); |
| 297 | |
| 298 | return out; |
| 299 | } |
| 300 | |
| 301 | |
| 302 | /** |
| 303 | * @brief Bytes per element (as supplied to @ref queue_create). |
| 304 | * |
| 305 | * @param q Queue pointer. NULL returns 0. |
| 306 | * @return Per-element size in bytes. |
| 307 | */ |
nothing calls this directly
no test coverage detected